httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject RE: [users@httpd] Help with redirect/rewrite
Date Fri, 21 Nov 2003 15:46:14 GMT

On Fri, 21 Nov 2003, Timothy Arnold wrote:

> Sorry, this is what appears to happen.
>
> I have two redirects:
>
> /fpp			http://ferl.becta.org.uk/display.cfm?page=403
> /fpp/			http://ferl.becta.org.uk/display.cfm?page=403
>

Redirect does substring matches on the url-path, so /fpp matches /fpp/ or
even /fppfoobar.  The part after /fpp is tagged onto the end of the target
URL.

The way you have it now, the second redirect is never used because the
first one matches against both /fpp and /fpp/.

It would probably work if you reversed the order of the two Redirects.

But a cleaner way to do it is

RedirectMatch /fpp/? http://ferl.becta.org.uk/display.cfm?page=403

RedirectMatch uses regular expressions rather than substring matches.

Depending on the version, Redirect(Match) may not handle query strings, in
which case you'd need:

RewriteEngine On
RerwiteRule ^/fpp/? http://ferl.becta.org.uk/display.cfm?page=403

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message