Re: rewritecond problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 24/02/2013 2:29 PM, "Coughlin, Michael J" <Michael.Coughlin@xxxxxxx> wrote:
>
> I have a RewriteCond issue:
>
>  
>
> I have a URI: /II/anydirectory/anyfile
>
>  
>
> I can get an exact match:
>
>  
>
> RewriteCond %{REQUEST_URI} ^/II/([^/]+)/(.+)$
>
>  
>
> So if I want the /II part to be optional in the match:
>
> RewriteCond %{REQUEST_URI} ^(/II)?/([^/]+)/(.+)$
>
>  
>
> Now any thing can get through, since the /II part is optional, it seems to be taken out of the equation and I am left with the equivalent of:
>
>  
>
> ^/([^/]+)/(.+)$
>
>  
>
> Of course /II/anyfile now matches, not the required /II/anydirectory/anyfile
>
>  
>
> So why is the fact that (/II)?
The ? means zero or one of II which means when not present matches anything really do you agree??

IS in the URI, but not considered now as part of the overall match?  Is this just a rule of optional groupings that they will get ignored in the match?
>
>  
>
> Thanks
>
>  


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux