SEOCentro
Search SEO Blogs Archive:

Search SEO Posts Last 14 Days





Avoiding duplicate content with mod rewrite

(Page 2 of 6)

Avoiding duplicate content problems by canonicalize the domain names and index pages with the help of mod rewrite. Canonicalization is the process of picking the best url when there are several choices, and it usually refers to home pages. For example, most people would consider these the same urls:
  • http://www.example.com/
  • http://example.com/
  • http://www.example.com/index.html
However technically all of these urls are different and a web server could return completely different content for all the urls above. But in most cases the web server return for all the urls above the same content, what can causes duplicate content problems. You can avoid that by redirecting non-www and IP address to www hostnames and /index.html pages to / pages.
RewriteEngine On
# Redirect non-www and IP addresses to www.
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
EXPLAIN: In this case the requested url http://example.com/foo.html would redirected to the url http://www.example.com/foo.html.
# Redirect direct client requests for "<anything>/index.html" to "<anything>/"
RewriteRule ^(([^/]+/)*)index\.html http://www.example.com/$1 [R=301,L]
EXPLAIN: In this case the requested url http://www.example.com/index.html would redirected to the url http://www.example.com/.

NEXT » Redirect relocated urls with mod rewrite



Article Index
1. Use mod rewrite for SEO purposes

2. Avoiding duplicate content with mod rewrite

3. Redirect relocated urls with mod rewrite

4. Redirect non existing inbound links with mod rewrite

5. Search Engine friendly urls with mod rewrite

6. mod rewrite for SEO purposes put together

Featured Sponsors








Sponsor SEOCentro

Featured Links
SEO Services
Simple, Effective pay monthly SEO Services.
Improve Page Rank
High Page Rank Links with Lifetime Guarantee!
Directory Submission Service
Free DMOZ submission with any directory submission plan (starts at $14)
search engine marketing
Jcyber provides Search engine marketing solution to Real estate professionals nationwide.
15 Day Trial for PPC Management
Try PPC on Google while working on your SEO. AdFicient has 10 years experience, Google certified and 24/7 support.
Sponsor SEOCentro

SEO Services
Latest SEO & Search Engine News
Latest seo and search engines blogs news for to stay up-to-date in the search engines marketing world.

Search Engine Optimization Tools
Online search engine tools, made available to help our visitors with their search engine strategy.