homepage Welcome to WebmasterWorld Guest from 23.20.149.27
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque & physics

Webmaster General Forum

    
301 redirect from specific countries?
301 redirect
roaster200




msg:4202017
 7:51 am on Sep 15, 2010 (gmt 0)

Is it possible to use a 301 redirect for specific countries only?

For example, when mysite.com is clicked in Germany, it redirects to the new site.

However when mysite.com is clicked in the UK, it goes to the original site

Is that possible at all?

 

lammert




msg:4202170
 2:32 pm on Sep 15, 2010 (gmt 0)

You can achieve this if your site is based on a scripting language like PHP. With every page request your scripts first check the IP address of the visitor. Based on the country associated with that IP address a 301 header is generated, or the regular content of the page is displayed.

You don't need to maintain a list of IP address and country associations yourself. There are paid and free IP databases available which you can use from within your scripts. You should know that these databases are not 100% accurate so you may now and then redirect visitors erroneously. Also frequent updating of the database is necessary because new IP address blocks are handed out on a continuous base.

roaster200




msg:4202181
 2:39 pm on Sep 15, 2010 (gmt 0)

Ok great thanks. Can you tell me of the services that supply these databases?

lammert




msg:4202192
 2:49 pm on Sep 15, 2010 (gmt 0)

There are several services. You can find them with Bing or Google with search terms like country ip database.

roaster200




msg:4202202
 3:01 pm on Sep 15, 2010 (gmt 0)

great thanks mate

roaster200




msg:4202661
 10:04 am on Sep 16, 2010 (gmt 0)

I am wondering, is it possible to do the following:

When a person in Dubai search for a word, mysite.com shows No.1 in the SERPS, when that person clicks the link it redirects to mysite2.com

So what I am thinking, is that the redirect picks up the location from where the link has come from i.e. someone in dubai.

Is that possible?

roaster200




msg:4204234
 2:32 pm on Sep 20, 2010 (gmt 0)

bump

phranque




msg:4204481
 10:05 pm on Sep 20, 2010 (gmt 0)

you can certainly redirect based on referer (HTTP_REFERER), such as www.google.ae, or based on an IP (REMOTE_ADDR) of a visitor which location is known.
for the latter you will need to use an IP geolocation database.

roaster200




msg:4204634
 7:45 am on Sep 21, 2010 (gmt 0)

ok great. I think the referer would work better. I will look into this. Any tips on where to look?

phranque




msg:4204635
 7:50 am on Sep 21, 2010 (gmt 0)

what server platform are you using?

roaster200




msg:4204638
 8:04 am on Sep 21, 2010 (gmt 0)

linux

phranque




msg:4204642
 8:34 am on Sep 21, 2010 (gmt 0)

apache?

roaster200




msg:4204644
 8:39 am on Sep 21, 2010 (gmt 0)

sorry yes

phranque




msg:4204652
 8:53 am on Sep 21, 2010 (gmt 0)

the RewriteCond directive would be similar to those used for the Access Restriction example for robots:
http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html#access [httpd.apache.org]

for the RewriteRule directive, here is the full mod_rewrite doc for Apache 2.0:
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html [httpd.apache.org]

any specific redirect questions should be posted in the Apache Web Server [webmasterworld.com] forum.

roaster200




msg:4204655
 9:01 am on Sep 21, 2010 (gmt 0)

thank you very much for your time. I appreciate the help

roaster200




msg:4204656
 9:02 am on Sep 21, 2010 (gmt 0)

Quick question, I am correct in thinking this will still tell Google that the site has moved and help with SERPS. The old site ranks high and I want to pass that onto the new site

phranque




msg:4204751
 1:58 pm on Sep 21, 2010 (gmt 0)

in general, if you treat the crawler in the same way as you treat the search-referred visitor, you'll probably be ok.
however you should be aware that any time you are cloaking you are playing with fire, so you need to know precisely what you are doing, why and how.

roaster200




msg:4204758
 2:03 pm on Sep 21, 2010 (gmt 0)

Its basically I am closing one site down and dont want to lose any traffic. I own both sites

phranque




msg:4204766
 2:18 pm on Sep 21, 2010 (gmt 0)

your question in the OP and the question i answered indicated a form of location-based cloaking.

roaster200




msg:4204777
 2:27 pm on Sep 21, 2010 (gmt 0)

I dont know what clocking is mate. Not sure what you mean

phranque




msg:4205025
 10:46 pm on Sep 21, 2010 (gmt 0)

Cloaking [webmasterworld.com]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved