Topic: SEO canonical 301 redirect
Hello,
As you know some search engines can penalize your site for duplicate content.
The reason is that they see these URL like different pages:
forexsb.com
forexsb.com/
www.forexsb.com/
www.forexsb.com
forexsb.com/index.html
www.forexsb.com/index.html
To prevent this I found .htaccess 301 redirection script in the net. It does this job as well as it redirects the sub domains properly also. I'm currently using this script on my website.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]
RewriteCond %{HTTP_HOST} !=""
RewriteCond %{HTTP_HOST} !^forexsb\.com
RewriteRule (.*) http://forexsb.com/$1 [R=301,L]
This code redirects all the shown URLs to:
http://forexsb.com/
Here you are how it works:
URL to check : http://www.forexsb.com/index.html
URL: http://www.forexsb.com/index.html ... redirected (301)
URL: http://www.forexsb.com/ ... redirected (301)
URL: http://forexsb.com/ ... found.
Well, I'm not an Apache guru so I would like to comment this script against possible issues.
Best Regards!