Forum Moderators: phranque

Message Too Old, No Replies

301 only redirect domain

301 redirect domain

         

jayzee

4:41 pm on Nov 16, 2005 (gmt 0)

10+ Year Member



Hi,

I have used a 301 redirect in my httpd.conf file to forward all my clients domains to their main domain as the general concensus is that thsi is the best way to approach multiple domains situation without making search engines think I am duplicating content.

My problem being that one of my domains the .co.uk version of the sites main .com domain most likely has links to pages on it as this was the first domain to be used and was swapped over later to the .com.

if i type the .co.uk domain into my browsers address bar, it successfully redirects to my main .com address BUT if I type in a page that once existed such as www.domain.co.uk/home.php it just comes up with the page cannot be displaid error.

my redirect looks like

<virtualhost 192.#*$!.xxx.xxx>
servername www.domain.co.uk
redirect 301 / [domain.com...]
</virtualhost>

I was expecting this to redirect anything through to the new .com domain but currently it doesn't seem to be working like that.

any advice to what is going wrong here would be much appreciated.

J

jdMorgan

4:53 pm on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The proper syntax would be:

Redirect 301 / http://www.example.co[b]m/[/b]

Jim

jayzee

5:06 pm on Nov 16, 2005 (gmt 0)

10+ Year Member



thanks for that, but should the
statement

Redirect 301 / [domain.com...]

allow, lets say the url [domain.co.uk...] to be redirected to [domain.com...] or do I have to put some sort of wildcard in to tell it to forward all files not just the domain

thanks for the speedy reply

J

jdMorgan

9:12 pm on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> allow, lets say the url http://www.example.co.uk/home.php to be redirected to http://www.example.com

No, http://www.example.co.uk/home.php would be redirected to http://www.example.com/home.php, and http://www.example.co.uk/<anything> would be redirected to http://www.example.com/<anything>.

Redirect uses prefix-matching. See Apache mod_alias [httpd.apache.org] for more info.

Jim