.htaccess & regex

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-29-2004
Jon
 
Posts: n/a
Default .htaccess & regex

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.
  #2 (permalink)  
Old 06-29-2004
Justin Koivisto
 
Posts: n/a
Default Re: .htaccess & regex

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.
  #3 (permalink)  
Old 06-29-2004
Jon
 
Posts: n/a
Default Re: .htaccess & regex

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>?
  #4 (permalink)  
Old 06-29-2004
Justin Koivisto
 
Posts: n/a
Default Re: .htaccess & regex

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.
  #5 (permalink)  
Old 06-30-2004
Jon
 
Posts: n/a
Default Re: .htaccess & regex

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"?


  #6 (permalink)  
Old 06-30-2004
Jon
 
Posts: n/a
Default Re: .htaccess & regex

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! :(
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0