2 rules for 4 +1 hosts

Using a single web hosting account to host multiple sites

2 rules for 4 +1 hosts

Postby ctrnz » Tue Dec 04, 2007 6:23 am

Im trying to mod_rewrite following setup - 2 different rules for 4 hosts

uno.org/ -> www.duo.org/shop
www.uno.org/ -> www.duo.org/shop
e-uno.org/ -> www.duo.org/shop
www.e-uno.org/ -> www.duo.org/shop

uno.org/anythingelse -> www.duo.org/anythingelse
www.uno.org/anythingelse -> www.duo.org/anythingelse
e-uno.org/anythingelse -> www.duo.org/anythingelse
www.e-uno.org/anythingelse -> www.duo.org/anythingelse

But I can do only one at same time. Is it possible to make them both work?

Thanks
ctrnz
 
Posts: 2
Joined: Tue Dec 04, 2007 5:37 am

Postby richardk » Tue Dec 04, 2007 3:20 pm

What have you currently got? Where are you putting it?

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?(uno|e-uno)\.org$ [NC]
RewriteRule ^$ http://www.duo.org/shop/ [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?(uno|e-uno)\.org$ [NC]
RewriteRule ^(.+)$ http://www.duo.org/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

works great!

Postby ctrnz » Tue Dec 04, 2007 11:06 pm

Works like a charm. I could make work only one rule at the time. I guess because forgot about $1. Thank You very much!

richardk wrote:What have you currently got? Where are you putting it?

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?(uno|e-uno)\.org$ [NC]
RewriteRule ^$ http://www.duo.org/shop/ [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?(uno|e-uno)\.org$ [NC]
RewriteRule ^(.+)$ http://www.duo.org/$1 [R=301,L]
ctrnz
 
Posts: 2
Joined: Tue Dec 04, 2007 5:37 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 26 guests

cron