This is a discussion on .htaccess & regex within the Apache Web Server forums, part of the Web Server and Related Forums category; This .htaccess works: <FilesMatch "\.inc$"> Order allow,deny Deny from all </FilesMatch> But this ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This .htaccess works:
<FilesMatch "\.inc$"> Order allow,deny Deny from all </FilesMatch> But this will not: <FilesMatch "\.inc$ [NC]"> Order allow,deny Deny from all </FilesMatch> Why is the [NC] flag causing the regex not to work? Not working means Apache doesn't recognize the regex. Nothing I do will make the [NC] work. I'm using Apache 1.3. |
|
|||
|
Jon wrote:
> <FilesMatch "\.inc$ [NC]"> > > Why is the [NC] flag causing the regex not to work? Not working means > Apache doesn't recognize the regex. Nothing I do will make the [NC] > work. I'm using Apache 1.3. Never used regex outside of mod_rewrite, and I don't see anything about flags for FilesMatch, but you could try something like: <FilesMatch "\.[iI][nN][cC]$"> -- Justin Koivisto - spam@koivi.com PHP POSTERS: Please use comp.lang.php for PHP related questions, alt.php* groups are not recommended. |
|
|||
|
Justin Koivisto wrote:
> Jon wrote: > >> <FilesMatch "\.inc$ [NC]"> >> > > > Never used regex outside of mod_rewrite, and I don't see anything about > flags for FilesMatch, but you could try something like: > > <FilesMatch "\.[iI][nN][cC]$"> > Thanks, that works. Why do you suggest not using regex with <FilesMatch>? |
|
|||
|
Jon wrote:
> Justin Koivisto wrote: > >> Jon wrote: >> >>> <FilesMatch "\.inc$ [NC]"> >> >> Never used regex outside of mod_rewrite, and I don't see anything >> about flags for FilesMatch, but you could try something like: >> >> <FilesMatch "\.[iI][nN][cC]$"> > > Thanks, that works. Why do you suggest not using regex with <FilesMatch>? ??? I didn't say that. -- Justin Koivisto - spam@koivi.com PHP POSTERS: Please use comp.lang.php for PHP related questions, alt.php* groups are not recommended. |
|
|||
|
Justin Koivisto wrote:
> Jon wrote: > >> Justin Koivisto wrote: >> >>> Jon wrote: >>> >>>> <FilesMatch "\.inc$ [NC]"> >>> >>> >>> Never used regex outside of mod_rewrite, and I don't see anything >>> about flags for FilesMatch, but you could try something like: >>> >>> <FilesMatch "\.[iI][nN][cC]$"> >> >> >> Thanks, that works. Why do you suggest not using regex with <FilesMatch>? > > > ??? I didn't say that. > Why did you say "Never used regex outside of mod_rewrite"? |
|
|||
|
Jon wrote:
> Justin Koivisto wrote: > >> Jon wrote: >> >>> Justin Koivisto wrote: >>> >>>> Jon wrote: >>>> >>>>> <FilesMatch "\.inc$ [NC]"> >>>> >>>> >>>> >>>> Never used regex outside of mod_rewrite, and I don't see anything >>>> about flags for FilesMatch, but you could try something like: >>>> >>>> <FilesMatch "\.[iI][nN][cC]$"> >>> >>> >>> >>> Thanks, that works. Why do you suggest not using regex with >>> <FilesMatch>? >> >> >> >> ??? I didn't say that. >> > > Why did you say "Never used regex outside of mod_rewrite"? > > I'm sorry, I was reading "used" as "use", sorry! :( |