Created
November 17, 2015 23:29
-
-
Save pablodgonzalez/31c79b219dfdb7e46037 to your computer and use it in GitHub Desktop.
spa tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Don't rewrite files or directories | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] | |
# Redirect http://www. to just http:// | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] | |
RewriteCond %{QUERY_STRING} ^_escaped_fragment_= | |
RewriteCond %{HTTP_HOST} ^touchtyping.guru [NC] | |
RewriteRule ^ snapshots%{REQUEST_URI}-en.html [L] | |
RewriteCond %{QUERY_STRING} ^_escaped_fragment_= | |
RewriteCond %{HTTP_HOST} ^(es|pl|en).touchtyping.guru [NC] | |
RewriteRule ^ snapshots%{REQUEST_URI}-%1.html [L] | |
# Rewrite everything else to index.html to allow html5 state links | |
RewriteRule ^ index.html [QSA,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment