Created
February 22, 2014 15:30
-
-
Save Shaz3e/9156636 to your computer and use it in GitHub Desktop.
This file contains 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
# .htaccess - www -> http:// - http:// -> www - nice URLs | |
Options -Indexes | |
Options +FollowSymLinks | |
RewriteBase / | |
RewriteEngine On | |
## /id/product-name/ to index.php?id=id | |
RewriteRule ^([0-9]*)/(.*)$ index.php?id=$1 [L] | |
## non www to wwww ## | |
RewriteCond %{HTTP_HOST} . | |
RewriteCond %{HTTP_HOST} !^www\.site\.com [NC] | |
RewriteRule (.*) http://www.site.com/$1 [R=301,L] | |
## www to non www ## | |
RewriteCond %{HTTP_HOST} !^site\.com$ | |
RewriteRule (.*) http://site.com/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment