Forum Moderators: phranque

Message Too Old, No Replies

redirect from co.uk to .com

simple redirect

         

FearTheHands

12:24 pm on Mar 16, 2008 (gmt 0)

10+ Year Member



I am looking for a simple solution to redirect my co.uk site to a .com site

Basically any page - i.e.; www.mysite.co.uk/mypage.html should be redirected to www.mysite.com/mypage.html

The site is very large & I want to do this dynamically, so ideally looking for a way to append request for any page to the equivalent but with a different domain suffix as the sites will be mirrored for the time being.

One issue: I'm not certain that the co.uk host (simply.com) allows the rewrite function - is there anyway I can tell definitively ?
Or, is there an alternative way of doing this, say with a redirect ?

Thanks in advance ...

g1smd

6:04 pm on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You need a 301 redirect. Make sure it caters for both www and non-www URLs on both domains.

The code is posted several times per week if you look through recent posts, and the library threads.

Post your best effort code here if those examples don't solve your problem.

FearTheHands

6:55 pm on Mar 16, 2008 (gmt 0)

10+ Year Member



I am using this code:

------------
Redirect 301 / [mysite.com...]
------------

This appears to work a I want to - are there any issues I should be aware of / suggestions ?

g1smd

8:24 pm on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So you have a complete separate hosting plan, just to host one .htaccess file?

That's a waste.

Point all the domains to one server and use Mod_Rewrite to sort out the requests there.

FearTheHands

11:17 pm on Mar 16, 2008 (gmt 0)

10+ Year Member



"So you have a complete separate hosting plan, just to host one .htaccess file?
That's a waste."

No

I have a webserver that I host multiple domain names & sites on & need to redirect an entire site to a different domain name suffix