httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o o <bj_5...@yahoo.com>
Subject [users@httpd] Help with mod_rewrite and regex's
Date Mon, 23 May 2005 23:55:17 GMT
I have the following config:

<VirtualHost 1.2.3.4>
VirtualDocumentRoot
/usr/local/www/vhosts-test/%-2.0.%-1/htdocs
VirtualScriptAlias
/usr/local/www/vhosts-test/%-2.0.%-1/cgi-bin
<Directory "/usr/local/www/vhosts-test/*/htdocs">
RewriteEngine On
RewriteBase   /
# Redirect <subdomain>.example.com/<path> to
www.example.com/<subdomain>/<path>
# Skip rewrite if no hostname, if the requested
subdomain is www, or if image request 
RewriteCond %{HTTP_HOST} !(^$&^www\.) [NC]
RewriteCond %{REQUEST_URI} !^/images/
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI}
^([^.]+)\.example\.com(:80)?<>/([^/]*) [NC]
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
RewriteRule ^(.*) %1 [L]
</Directory>

This config works for testing purposes. However, I
want it to work as part of a larger mass vhost block,
so I need to change the RewriteConditions to meet that
requirement. So basically I need the above RewriteCond
statements changed to match wildcarded domains instead
of example.com. Hopefully someone with a better grasp
of pcre/regexes can help me out here.TIA


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message