Skip to content

Instantly share code, notes, and snippets.

@Grawl
Forked from joshmvandercom/.htaccess
Created November 22, 2012 15:20
Show Gist options
  • Save Grawl/4131673 to your computer and use it in GitHub Desktop.
Save Grawl/4131673 to your computer and use it in GitHub Desktop.
.htaccess redirect to hash
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} !ajax
RewriteRule ^(.*)$ /#$1 [R=301,L,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment