Re: RewriteMap questions

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

 



On 5/30/07, Josh Trutwin <josh@xxxxxxxxxxxxxxxxxxx> wrote:

Thanks - great suggestions - now my next issue.  This is all done in
VirtualHosts, I noticed RewriteMap cannot be declared in a .htaccess
so I put it in the VirtualHost like so:

<VirtualHost *:80>
        VirtualDocumentRoot /httpd/%0/html
        RewriteMap rewriter dbm:/httpd/%0/html/rewrite_map.db
</VirtualHost>

The RewriteMap doesn't seem to replace the %0 with the directory name
- so I have a directory /httpd/josh.test.com/html which has
rewrite_map.db.pag and rewrite_map.db.dir.  I created a .htaccess in
josh.test.com/html:

RewriteRule ^(.*) ${rewriter:$1} [R]

When attempting to access the site though I get a "No such file or
directory" error on /httpd/%0/html/rewrite_map.db.pag

Can I declare the RewriteMap once as above to map to each
VirtualHost's directory?

No. The %0 notation is specific to mod_vhost_alias. It can't be used
in any other directive. (In particular, RewriteMaps are initialized at
server startup, so it doesn't work to make their location a
per-request variable.)

You can either manually define a separate rewritemap for each
hostname, or you can use a single rewritemap for all the hosts and use
the hostname as part of the lookup key.

Joshua.

---------------------------------------------------------------------
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