[users@httpd] Help with mod_rewrite and regex's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux