Grouping mod_rewrite statements.

Grouping mod_rewrite statements.

am 24.01.2008 12:05:45 von googy

Hi,


I have to sites say siteone.com, sitetwo.com. And I have updated
these two sites to point to one webhost. i.e these two sites share the
same webspace. I have created two sub folders and using mod_rewrite
to check domain name and transparently serve the pages from
corresonding folders. My problem is I have to put RewriteCond(only
checks for HTTP_HOST) before every RewriteRule. And keeping track of
all these statements are difficult. I want to know if its possible
to group all the corresonding RewriteRule togather and don't bother
about writing RewriteCond more than once.

Since the http GET & POST requests coming with two different host
names I think its possible to do. Please enlighten me on this issue.
One more thing I have to do all this magic inside .htaccess file.


Thanks.

Re: Grouping mod_rewrite statements.

am 24.01.2008 19:32:10 von Kees Nuyt

On Thu, 24 Jan 2008 03:05:45 -0800 (PST), Googy
wrote:

>Hi,
>
>
>I have to sites say siteone.com, sitetwo.com. And I have updated
>these two sites to point to one webhost. i.e these two sites share the
>same webspace. I have created two sub folders and using mod_rewrite
>to check domain name and transparently serve the pages from
>corresonding folders. My problem is I have to put RewriteCond(only
>checks for HTTP_HOST) before every RewriteRule. And keeping track of
>all these statements are difficult. I want to know if its possible
>to group all the corresonding RewriteRule togather and don't bother
>about writing RewriteCond more than once.
>
>Since the http GET & POST requests coming with two different host
>names I think its possible to do. Please enlighten me on this issue.
>One more thing I have to do all this magic inside .htaccess file.
>
>Thanks.

Would Name Based Virtual Host solve your problem?
http://httpd.apache.org/docs/2.2/vhosts/

I don't think rewriting is very suitable in this case.
--
( Kees
)
c[_] Its a JOKE, like the funny kind but different. (#74)