Another .htaccess example
admin
Working on many projects I am constantly facing the task of changing or (more often) creating .htaccess file. There is no reason to mention once again that its installment is very important for SEO purposes, but some people are not still aware of it.
At first it was like a nightmare: so many info on the Internet that I could not decide what advice to follow. .htaccess description on Apache’s official site is very nice but not for optimizers - rather for tech-gurus. Then I followed the experience of other sites, and tried to implement their examples on my projects. A better result but still unsatisfied - too many variants as many people there are.
And finally I’ve found (I believe) the core variant accessible for all. Try to install it on your server and you must forget about 301 redirect.
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\.nokeywordinurl\.com$ [NC]
RewriteRule ^(.*)$ http://www.nokeywordinurl/$1 [R=301,L]
- this part should redirect all non-www requests to www.nokeywordinurl.com
RewriteCond %{THE_REQUEST} ^.*\/index\.php?
RewriteRule ^(.*)index\.php?$ http://www.nokeywordinurl.com/$1 [R=301,L]
- and this one redirects your index.php (in my example) to www.nokeywordinurl.com/ . In case you have index.html - just change php to html or whatever you have.
Posted in SEO Related |

