Mobile app version of vmapp.org
Login or Join
Hamaas447

: Geotargeting based SEO problem I have a website and it redirects users to their corresponding U.S. states page if they are in the U.S. region. For example, if I am in New York and I go to

@Hamaas447

Posted in: #Geotargeting #Seo

I have a website and it redirects users to their corresponding U.S. states page if they are in the U.S. region. For example, if I am in New York and I go to the website the page automatically redirected me to domainname.com/newyork. If I am from India, it opens the home page and asks me to select the state.

So for domainname.com, if I search for this website on Google, it shows domainname.com/california as a home page.

How can I rectify this? I want domainname.com as the home page for search engines.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamaas447

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kimberly868

Your question doesn't state any details about your hosting environment, however supposing you were on a Linux/Apache/PHP web server configuration, you might use a RewriteRule in a .htaccess file in the website public root folder such as the following to make sure that search engines are dealt your homepage before any clever location-based routing is applied:


RewriteCond %{HTTP_USER_AGENT} AltaVista [OR]
RewriteCond %{HTTP_USER_AGENT} Bingbot [OR]
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteRule ^.*$ www.example.com/index.php?state=none [L,QSA]


Obviously you can add as many search engines to the list as you like, check the Search Engine Dictionary for a list of spider names. The [L] switch makes this the last rule to apply if any of the preceeding conditions were met. The [QSA] switch preserves any query string that might exist before this rule is applied. I've made up a script index.php and a parameter value pair state=none as an example of how you could identify this scenario from your pages.

If you're using a different hosting environment or server-side programming language then I'm sure the same principles could apply with a slightly different implementation.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme