thanks a lot for your help, it really enlightened my mind.

For the moment i managed to make it work with 2 maps :


RewriteMap vhost txt:/var/www/vhost.map
RewriteMap master txt:/var/www/master.map

RewriteCond ${master:${lowercase:%{SERVER_NAME}}|default} !=default
RewriteRule ^/(.*)$ /var/www/hosts/${lowercase:%{SERVER_NAME}}/web/$1 [L]
RewriteCond ${vhost:${lowercase:%{SERVER_NAME}}|default} !=default
RewriteRule (.*) http://${vhost:${lowercase:%{SERVER_NAME}}}$1 [R=301,L]



I'll investigate and make your first solution work, which, if there's no perf difference, is easier to maintain.

Thanks again
Greg


Joshua Slive a écrit :

On 12/6/05, gregory duchesnes <[EMAIL PROTECTED]> wrote:
Beware, mail crossing ;)

I'm beginning to understand your logic, though i don't see why it should
be faster since you do a lookup in vhost.map for each request.
In the case aliases are used only once in a while it could even be slower.

But, if i follow your idea, and since mapping are cached, the best
performance might be achieved with 2 maps, one for the master domain and
one for the aliases with something, no system access in this case, am i
right?

Probably the speed difference is not important.  Your solution
required a stat on every request (the -d), mine required a map lookup.
But I try to avoid the -d/-f/etc options of mod_rewrite because I
find they complicate things and sometimes lead to unexpected results.

I don't think it is necessary to have two maps if your filesystem is
already structured properly for the canonical domain names.

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: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
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: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to