Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my first post here, so be gentle...

A friend wanted a website and paid for one to be set up. For reasons unknown to me he ended up with hissite.co rather than hissite.co.uk, which is what he wanted. He's had lots of problems appearing on Google searches and I suspect that Google is assuming the site is Columbian and thus (sensibly) not showing it to users in the UK. It would be great if anyone could confirm this.

So to help, I've bought the .co.uk version and put a 301 redirect in that looks like this:

Redirect 301 / http://www.hissite.co

The redirect is working, but I'd like the URL to be masked so that the original URL doesn't show up. This should be simple but my Google-fu is letting me down. Could someone offer a correction?

share|improve this question
If you want this "transparent" redirect then you are using wrong approach -- you need to use what is called "Reverse Proxy". For that use these 2 Apache modules: mod_rewrite and mod_proxy. For examples and help check stackoverflow.com or Apache's documentation: httpd.apache.org/docs/current/rewrite/proxy.html ; httpd.apache.org/docs/current/mod/mod_proxy.html – LazyOne Apr 25 '12 at 11:02
@LazyOne, even that will cause problems if there are some absolute URLs sent by the site to itself (see this question). The best approach certainly is to point the new DNS entry to the old and configure the site to use that instead. – Bruno Apr 25 '12 at 13:33

A 301 redirect is not going to help in your case: search engines treat a 301 redirect from A to B as in instruction to index the URL B instead of A. Thus, your .co.uk domain will never show up in Google results, since it contains nothing but 301 redirects.

(I suppose it is possible that the existence of the .co.uk domain may affect Google's geotargeting algorithms, at least if other sites mainly link to it rather than to the .co domain — I don't really have any hard data or authoritative information on that.)

Instead, you and your friend should make the site itself appear under the .co.uk domain. From your end, this may be as simple as configuring a DNS alias (a CNAME record) from hissite.co.uk to hissite.co. If your friend's site is on a dedicated server (or an IP-based virtual host), this will be enough; however, if it's on a name-based virtual host, the webserver will also have to be configured to recognize hissite.co.uk as an alias for your friend's website.

You and/or your friend may want to contact your friend's hosting provider and ask them how to best set this up; they may be willing to help, or even to suggest an easier (or cheaper) way than what I've described above.

Once you've got the site working under both domains, I'd recommend setting the original .co domain to return 301 redirects to the .co.uk domain. That way, you won't have the same content appearing on two different domains, which could cause SEO issues (not to mention general user confusion).

If you can't or don't want to do that for some reason, you could also tell your friend to register his site on Google's Webmaster Tools and use the geotargeting settings there to target the site for users in the UK. Normally this is not possible for sites under a country-specific TLD, but fortunately for your friend, Google treats .co as a generic top-level domain, and so allows changing the geotargeting settings for sites under it.

Another trick that might work would be to replace your 301 redirects with 302s and have your friend include a rel=canonical meta tag on all his pages pointing to the corresponding URL on the .co.uk domain. However, I really would rather recommend just trying to make the site appear under the correct domain in the first place.

Setting your .co.uk site to act as a transparent proxy for your friend's site, as LazyOne suggests in the comments, is also one solution, but not one I'd recommend either. From the user's viewpoint, it will look pretty much the same as a DNS alias, but it's more technically complex and thus typically slower and more prone to failure. Its one advantage over a DNS alias is that you can set up such proxying entirely from your end, even if your friend's site is hosted on a name-based virtual host.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.