Re: Need a conditional rewrite/redirect rule

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

 



On Thu, Feb 7, 2019 at 4:25 PM Darryl Philip Baker
<darryl.baker@xxxxxxxxxxxxxxxx> wrote:
>
> I don't write conditional rewrite rules often but this is a case where I need one. My customer wants the affect of:
>
>
> RedirectMatch permanent ^/foo/bar/(.*)$  http://www.example.com/foo/bar/file.html
>
> Which would of course create a redirect loop.
>
> What I want is a conditional rewrite or redirect rule which would send requests for http://www.example.com/foo/bar/{any file or path} except http://www.example.com/foo/bar/file.html to http://www.example.com/foo/bar/file.html.
>
> Anyone solved this already and is willing to share?

Here's an example w/ "negative lookahead" in PCRE.

RedirectMatch permanent ^/foo/bar/(?!file.html$)
http://www.example.com/foo/bar/file.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[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