Switch to English
( Blog «REQUEST_FILENAME»)

Erreur Apache HTTPD: NoCase option for non-regex pattern is not supported and will be ignored.

Écrit par Sparko | 4 janvier 2010 | 0

Une erreur Apache est venue poluer les logs d'un de nos serveurs.  On (les programmeurs en général) a souvent tendance à ajouter la balise [NC] dans nos fichiers .htaccess pour ne pas tenir compte de la casse en utilisant RewriteCond.

L'erreur déclenchée est alors:
 

[warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.

[warn] RewriteCond: NoCase option for non-regex pattern '-d' is not supported and will be ignored.

 

Alors plutôt que d'utiliser ceci dans le .htaccess
 

RewriteCond %{REQUEST_FILENAME} !-f [NC,OR]

RewriteCond %{REQUEST_FILENAME} !-d [NC]


il faudrait plutôt utiliser:
 

RewriteCond %{REQUEST_FILENAME} !-f [OR]

RewriteCond %{REQUEST_FILENAME} !-d

 

Une autre solution, bien meilleure celle-là est d'utiliser
 

RewriteCond %{REQUEST_FILENAME} -f

RewriteRule "." - [skip=100]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule "." - [skip=100]

 

Tags: apache, htaccess, httpd, NoCase, REQUEST_FILENAME, rewriteCond,

Catégorie: Gratuit

Partager: