PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > Strange apache's mod_rewrite and file/directory existance test behavior
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

Strange apache's mod_rewrite and file/directory existance test behavior

Réponse
 
LinkBack Outils de la discussion
Vieux 08/02/2005, 11h43   #1
marc.poulhi-NO-es-SPAM@epfl.ch
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Strange apache's mod_rewrite and file/directory existance test behavior

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
  Réponse avec citation
Vieux 08/02/2005, 12h37   #2
André Malo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange apache's mod_rewrite and file/directory existance testbehavior

* 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
  Réponse avec citation
Vieux 08/02/2005, 13h16   #3
marc.poulhi-NO-es-SPAM@epfl.ch
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange apache's mod_rewrite and file/directory existance test behavior

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h32.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07789 seconds with 11 queries