httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pete Houston <>
Subject Re: [users@httpd] Rewrite Rule Rewriting root site
Date Fri, 19 Apr 2013 08:51:42 GMT
On Mon, Apr 15, 2013 at 06:57:13PM -0400, Chris Arnold wrote:
> We have a server at We also have another site/app that runs at
We host client applications on our server using apache so the above site/app needs to be http://apps.ourclientsdomain.tld.
Here is what i have gotten to work in the site/app virtual host file:
> ServerName apps.*
>     RewriteEngine On
>     RewriteCond %{HTTP_HOST} ^apps\.
>     RedirectMatch ^/$ /somealias/
> This appears to work, however, it has also taken over our root site. So
now takes you to http://rootsite/somealias. How can i stop this from happening? I assume i
have something amiss in the above rewrite?

Here is a possible solution without mod_rewrite:

	... config specific to this site here ...

	ServerAlias apps.*
	... config specific to this other site here ...
	UseCanonicalName Off
	RedirectMatch	^/$	/somealias/

In this way the Redirect only applies to the virtual hosts which are
specified and leaves all others untouched. The added bonus is that you
can avoid loading the heavy mod_rewrite at all.


Openstrike - improving business through open source or call 01722 770036 / 07092 020107

View raw message