httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: [users@httpd] Need a conditional rewrite/redirect rule
Date Thu, 07 Feb 2019 22:07:36 GMT
On Thu, Feb 7, 2019 at 10:25 PM Darryl Philip Baker
<darryl.baker@northwestern.edu> wrote:
>
> 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?

No need for a rewrite rule, something like:
RedirectMatch permanent ^/foo/bar/(?!file.html$)(.*)$
http://www.example.com/foo/bar/file.html
(where (?!...) stands for not followed by ...)

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message