soyglobal
asked on
rewritecond if is serveralias
Hi, i want do a rewrite in apache that the unique condition if the host is one of the different serveralias (more than 90 domains).
How i can do it without use a rewritecond line per each domain.
Thanks
How i can do it without use a rewritecond line per each domain.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I know this way, but the problem is that rule not apply to all server alias,
Where do you add this rule ? .htaccess file or apache configuration ?
ASKER
Apache configuration in virtualhost
perhaps your rewrite rule is overriden by a .htaccess file
ASKER
the problem not is that rewrite failed, my problem is how manage a rewritecond with near 75 conditionals
rewritecond %{HTTP_HOST}= domain1 or
rewritecond %{HTTP_HOST}= domain2 or
....
rewritecond %{HTTP_HOST}= domain75 or
rewrite from / to the moon.foo
I think apache should has a way for do it more simple and fast
rewritecond %{HTTP_HOST}= domain1 or
rewritecond %{HTTP_HOST}= domain2 or
....
rewritecond %{HTTP_HOST}= domain75 or
rewrite from / to the moon.foo
I think apache should has a way for do it more simple and fast
What exactly do you want ? give us some samples.
foo.bar.com => www.bar.com ?
bla.bla.com => bla.com ? ...
You can certainly achieve this with some regex
foo.bar.com => www.bar.com ?
bla.bla.com => bla.com ? ...
You can certainly achieve this with some regex
ASKER
I need some this:
if http_host = one of 75 group1 alias domain go to www.foo.com
if http_hots = one of 20 group2 alias domain go to www.blaba.com
the problem is the number of values to check (75 and 20), and increasing per month
if http_host = one of 75 group1 alias domain go to www.foo.com
if http_hots = one of 20 group2 alias domain go to www.blaba.com
the problem is the number of values to check (75 and 20), and increasing per month
What about using 4 different <virtualhost *:80> sections? One for www.foo.com, one for www.blaba.com, one for aliases of www.foo.com and one for aliases of www.blaba.com; while you put a simple
Redirect 301 / http://www.foo.com
into the "alias" <virtualhost >'s instead of brothering with mod_rewrite.
Redirect 301 / http://www.foo.com
into the "alias" <virtualhost >'s instead of brothering with mod_rewrite.
ASKER
because i don't want do a redirect, i need have as i put before
rewrite on
rewritecon http-referrer = one of group1 alias
rewriteurl (.)* http://bkjkj.com/?redirect-host=http-referrer qsa, l
rewritecon http-referrer = one of group2 alias
rewriteurl (.)* http://app.foo.com/?redirect-host=http-host qsa, l
rewrite on
rewritecon http-referrer = one of group1 alias
rewriteurl (.)* http://bkjkj.com/?redirect-host=http-referrer qsa, l
rewritecon http-referrer = one of group2 alias
rewriteurl (.)* http://app.foo.com/?redirect-host=http-host qsa, l
Open in new window