Skip to content

Instantly share code, notes, and snippets.

@rolia17
Created October 21, 2014 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolia17/49d7573a9ecc869dd994 to your computer and use it in GitHub Desktop.
Save rolia17/49d7573a9ecc869dd994 to your computer and use it in GitHub Desktop.
Apache /page.html to /page rewrite rule
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://YOURSITE.ru/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment