Last Updated: 12 Nov 2023

   |   

Author: 114.119.158.189

Using .htaccess redirects for a 'Map' or Splash Page

Many large companies have divisions all over the world, and thus the first time you come to their site, you get a world map asking you to 'Choose Your Location'. This is great for users, but terrible for SEO, because all the great indexable content from your real homepage is now 'hidden' behind a link on the map.

How do you overcome this? Use an .htaccess file to redirect the bots to the URL of your real homepage, so they never see the map/location selection page. In this example, we're redirecting http://www.mysite.com/ to http://www.mysite.com/usa/:

RewriteCond %{HTTP_USER_AGENT} (.*)(googlebot|msnbot|slurp|teoma|spider|crawler)(.*) [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/usa/ [R=301,L]

A few notes on this technique: technically, this could be considered 'cloaking', since you're sending humans to one page and the bots to another. After polling several SEO experts, and trying it myself, it doesn't seem to have an adverse effect, but I'd be very careful trying this on anything but your homepage.

Interestingly, Google and Yahoo seem to index the contents of your /usa/ page, but link to your / page (e.g. the map page). In other words, the URL http://www.mysite.com/ shows up in the search results, but with the title tag and meta description from http://www.mysite.com/usa/! This is actually what I'd want to happen… normal users should still be directed to the map page, but the search engine should display the content from your 'real' homepage in the search engine results. MSN is not so smart: it links to http://www.mysite.com/usa/.

Discussion

Kokul, Mar 29, 2012 03:27 AM

robots.txt: People Done2€™t Want SE's to Crawl Content What goes through your mind when you read about the silly liuawsts against Google accessing portions of your website? What do you think when you visit the Internet Wayback Machine and find hundreds of pages of your site in its full form (almost)?

Enter your comment. Wiki syntax is allowed: