DotDragnet
May 24, 2012, 07:34:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: redirection problem  (Read 208 times)
SLEE
Hero Member
*****
Posts: 824



View Profile WWW Awards
« on: October 06, 2011, 08:29:19 AM »

Hi all, I am hoping can shed some light on the problem I am having.

I have two WP sites one for the UK and one for the USA they look almost the same but the pages are different.

the sites run on www.domain.com and www.domain.com/us

On the www.domain.com version I have added a plugin (GEO Redirect) that redirects a user by their ip address so if they are from the USA they get moved onto the USA version.

The problem I have is that when you share a link on LInkedIn, Facebook or Twitter because their servers are in the USA the link system they use which scrapes the site for information also gets redirected to the USA version.

Is there any way around this?
Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
Dom
Hero Member
*****
Posts: 1681


Taster of pasities. Clanger of both pots AND pans.


DominicNeagle
View Profile Awards
« Reply #1 on: October 06, 2011, 09:12:57 AM »

I'm no expert with mod_rewrite and .htaccess, but I'm sure you could add rules in to your .htaccess file that allowed anyone coming from, for example, *.twitter.com to use the UK version instead of the US. So you could set up rules for common social networks so that their link scrapers are always redirected to the UK site.

I guess the problem then might be that some links might actually be posted from the US version of the site to Twitter etc, but the redirects from Twitter will redirect scrapers and people to the UK version. Hmm, seems like a bit of a pickle.


Edited for typo.
« Last Edit: October 07, 2011, 08:57:38 AM by Dom » Logged

JasonD
Global Moderator
Hero Member
*****
Posts: 551



View Profile Awards
« Reply #2 on: October 06, 2011, 03:44:44 PM »

RewriteCond %{HTTP_USER_AGENT} twitter [OR]
RewriteCond %{HTTP_USER_AGENT} whatever
RewriteRule (.*) $1?no_redirect

With appropriate user agent strings. Maybe.
Logged
SLEE
Hero Member
*****
Posts: 824



View Profile WWW Awards
« Reply #3 on: October 10, 2011, 03:54:36 PM »

Thanks guys I iwll try and dig a bit deeper into how the plugin redirects and see if i can use the code you provided Jason.
Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!