Skip to content

Instantly share code, notes, and snippets.

@nzifnab
Created December 5, 2012 23:44
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 nzifnab/4220570 to your computer and use it in GitHub Desktop.
Save nzifnab/4220570 to your computer and use it in GitHub Desktop.
Force redirect 'html' and 'shtml' to use a non-extension url
RewriteEngine on
RewriteCond %{THE_REQUEST} /(.*)\.s?html
RewriteRule ^.*$ /%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME}\.shtml -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*/?[\w\d\-]+)$ $1.shtml [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment