httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Bowen <>
Subject Re: [users@httpd] Subdomain rewrite
Date Thu, 22 Mar 2012 13:02:06 GMT

On Mar 21, 2012, at 8:09 PM, Chris Arnold wrote:

> Apache 2.2.12 on SLES11 SP2. I am trying to get a subdomain working via a rewrite rule,
> The rule is in its own vhost (helpdesk.teknerds.conf. I am confused if it needs its own
vhost or if the rewrite should go in teknerds.conf vhost) and follows:
> <VirtualHost *:80>
>    ServerAdmin
>    ServerName
>    ServerAlias *
>    RewriteEngine On
>    RewriteCond %{HTTP_HOST} !^(www|m|secure|admin).* [NC]
>    RewriteCond %{HTTP_HOST} ^([^\.]+)\.teknerds\.net
>    RewriteCond /opt/otrs/bin/cgi-bin/%1 -d
>    RewriteRule ^(.*) /%1/$1 [L]
>    DocumentRoot /opt/otrs/bin/cgi-bin/
> <Directory "/opt/otrs/bin/cgi-bin/">    
> 	#
> 	# Controls who can get stuff from this server.
> 	#
> 	AllowOverride FileInfo AuthConfig Limit Indexes
> 	Options Indexes ExecCGI FollowSymLinks
> 	Order allow,deny
> 	Allow from all
>    </Directory>
> The behavior that is happening is a listing of the site and it takes over all sites.
So when you goto, it lists the files in the doc root. If you
goto it is the same listing as above. I expect to
be its own site and all other sites to be there own.

Forgive me for asking an obvious question, but have you considered just having separate virtualhost
blocks for each virtualhost? If you put a virtualhost for before this
vhost, then it will catch that hostname before the wildcard serveralias is considered.

Rich Bowen :: @rbowen

View raw message