How can i avoid duplicated index page using mod rewrite?

Nowadays a SEO is important for a good ranking in search engines.

Google and many other search engines can tag your index page as duplicated if they find that the same page is showing when they go to:

 

http://www.yoursite.com

or

http://www.yoursite.com/index.html (or index.php, etc.)

 

To avoid this you can use the following rewrite rule in your .htaccess file:

 

RewriteEngine On
# Remove index.
RewriteCond %{THE_REQUEST} \ /(.+/)?index(\?.*)?\  [NC]  
RewriteRule ^index.html$ http://www.yourdomain.net/%1 [R=301,L]

 



  • 0 Users Found This Useful
Was this answer helpful?
Related Articles
Copyright © 2020 PlusPlusHosting.Net. All Rights Reserved.
2Checkout.com is an authorized reseller of goods and services provided by PlusPlusHosting.Net.