httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Szymon Bakowski" <szy...@bakowski.net>
Subject Re: [users@httpd] mod_rewrite and Redirect directive
Date Tue, 29 Jan 2008 12:43:05 GMT
On 29/01/2008, Vincent Bray <noodlet@gmail.com> wrote:
> On 29/01/2008, Szymon Bakowski <szymon@bakowski.net> wrote:
> > mod-rewrite and Redirect directive: what I wanted to achieve is to
> > include from within VirtualHost a file for permanent redirections
> > (using simply "Redirect" inside )and one for mod_rewrite directives.
> > From some reason I cannot make Redirect directive make work at all
> > (whether I include it before or after inclusion of the file with
> > mod_rewrite rules).
>
> Your rewrite rules will always run, regardless of there being a
> Redirect directive (before or after doesn't matter) that matches the
> request. You have a number of options:
>
>  1) Guard your ruleset with RewriteCond %{REQUEST_URI} !^/path_used_in_redirect
>  2) Use mod_rewrite rather than Redirect, with RewriteRule's [R] flag
>  3) Do the rewriting anyway and if the result of the rewrite should
> then match a Redirect, use [PT] to make sure the Redirect gets a
> chance to match the rewritten path.
>
> HTH.
>
> --
> noodl

Brilliant. Thanks a million for your advice!

best regards
Szymon

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