Created
July 3, 2014 22:02
-
-
Save laurenclark/e894b431bd100fd9c17d to your computer and use it in GitHub Desktop.
htaccess example
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
# REWRITES | |
# Canonical | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^site\.co.uk$ [NC] | |
RewriteRule ^(.*)$ http://www.site.co.uk/$1 [R=301,L] | |
RewriteCond %{THE_REQUEST} ^.*/index.html | |
RewriteRule ^(.*)index.php$ http://www.site.co.uk/$1 [R=301,L] | |
#prettyurls | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^([^\.]+)$ $1.php [NC,L] | |
#index to root | |
RewriteCond %{THE_REQUEST} ^.*/index\.php | |
RewriteRule ^(.*)index.php$ /$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment