Forum Moderators: phranque

Message Too Old, No Replies

Conditional 301 redirect?

Is it possible?

         

kapow

3:24 pm on Oct 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I build websites for businesses, each site I manage is in a sub-folder of my hosting account. So www.mysite.com is my root folder and say www.customer3.com is the same as www.mysite.com/customer3.

The problem is SERPS for my customers keywords showing www.mysite.com/customer3.

Is it possible to create a 301 redirect that only activates if the site has been found through the wrong url?

ie
If (spider or browser visits www.mysite.com/customer3)
{ redirect 301 / [customer3.com...] }

encyclo

5:26 pm on Oct 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you mean something like:

Redirect permanent /customer3
http://www.example.com/

In your main document root?

You can also use mod_rewrite in an .htaccess in the customer's document root to redirect depending on whether the

http_host
is their domain or not.

kapow

4:40 pm on Oct 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Redirect permanent /customer3 [example.com...]
In your main document root.

That looks good I'll try it. I didn't know redirect would do that - thanks :)

Would this work as well?:
Redirect 301 /customer3 [example.com...]