|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I have some RewriteCond to check if a given file within a directory exists. Both file and directory can be inexistant. The rule is: RewriteCond %{DOCUMENT_ROOT}/rfiles/${NodesToCluster:%{REMOTE_HOST}|default}/$1 -f RewriteRule ^/files/(.*)$ /rfiles/${NodesToClusters:%{REMOTE_HOST}|default}/$1 [L] Where the NodesToCluster is a map. If I have something like: /rfiles/mycluster/myfile and someone mapping to mycluster is requesting /files/myfile, all is ok. If I remove the 'myfile' from the directory, I get this error: File does not exist: /var/www/html/rfiles/mycluster/myfile I think that the RewriteCond should return false in that case... But the strange thing is that if I use something like: RewriteCond %{DOCUMENT_ROOT}/rfiles/${NodesToCluster:%{REMOTE_HOST}|default}/foo/$1 -f ^^^^^ It will not complain about foo not being there, it will return false and work as expected. I am reading and reading the docs, but I really don't understand how these tests are working. Marc |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
* marc.poulhi-NO-es-SPAM@epfl.ch wrote:
> I am reading and reading the docs, but I really don't understand how > these tests are working. First rule: setup the rewrite log (level 9) and look what's happening (i.e. post it here). nd |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
André Malo <auch-ich-m@g-kein-spam.com> writes:
> * marc.poulhi-NO-es-SPAM@epfl.ch wrote: > >> I am reading and reading the docs, but I really don't understand how >> these tests are working. > > First rule: setup the rewrite log (level 9) and look what's happening (i.e. > post it here). Hi, Last time I asked for , I promised myself to double/triple check I really can't understand the problem. I reread my config a thousand times this morning for being sure that was something I don't understand. Finally, after looking at the logs, I saw something really strange, and found that I made a small typo in the config (missing 's' at the end of NodesToClusters)... This was making the Cond true, but as the Rule was getting a different result from the map, this was not working correctly. Sorry for this message as this was not a problem from mod_rewrite! (it could complain when you try to use an undefined map...) Marc |
|
![]() |
| Outils de la discussion | |
|
|