Forum Moderators: phranque

Message Too Old, No Replies

Sub domains unchanged but domain different

subdomain url redirectmatch

         

MetalMarky

12:01 pm on Aug 27, 2008 (gmt 0)

10+ Year Member



Refering to topic [webmasterworld.com...]

I am trying to redirect the following. (Example...)

fish.food.co.uk to fish.chips.co.uk

The reason behind this is that both domains are owned and both used to advertise the website, and there could be many different subdomains, but in order to avoid duplicate content, I only want one of the domains to host the pages. Therefore I want to preserve the subdomain and change the domain.

On the server I am hosting on, I can change the webserver settings and I have tried to achieve the result I want using RedirectMatch. If I have to do this in .htaccess then I also need to rule to make all index.html go to index.php. This is the current contents in .htaccess for example.

RedirectMatch 301 (.*)\index.html$ www$1index.php

Any clues?

Thanks

Metal Marky

jdMorgan

4:46 pm on Aug 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suspect you will need to use mod_rewrite, and specifically, one or more RewriteConds examining %{HTTP_HOST} in order to solve this problem.

Multiple examples of the requested domains and the target domains would be helpful if you have further questions.

And to avoid confusion, please stick to one question at a time -- The "index.html" problem can be taken care of later.

Jim