Created
July 8, 2014 12:48
-
-
Save davidvandenbor/631229eee68aace98917 to your computer and use it in GitHub Desktop.
Handy .htaccess entries
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
| # hide index.php from the domain URL | |
| # for WordPress users: Permalink URL canonicalization is automated via PHP in WordPress 2.3+ | |
| RewriteEngine On | |
| RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] | |
| RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] | |
| # parked domains permanent 301 redirect so search engines not to treat them as duplicate content. | |
| RewriteEngine on | |
| RewriteCond %{HTTP_HOST} !^www.maindomain.com$ | |
| RewriteRule ^(.*)$ http://www.maindomain.com/$1 [R=301] | |
| # force only the www version of your web site, to make your_domain.com redirect to www.your_domain.com | |
| RewriteEngine on | |
| RewriteCond %{HTTP_HOST} !^www.your_domain.com$ | |
| RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment