You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Robinson Craig <Cr...@nrw.qld.gov.au> on 2007/10/31 00:41:45 UTC
[users@httpd] Exclusion possibilities for RedirectPermanent
Hi Folks,
I have to redirect any requests for a particular path to another server
for a few months, and I am successfully using:
RedirectPermanent /about http://newServer/about
However, an additional requirement has emerged where they want a
sub-directory within this path to not be redirected:
Eg. /about/announcements
Apart from putting in individual redirects for every directory under
/about, is there such a concept as an "exclusion list". For example,
redirect everything under /about EXCEPT /about/announcements.
Any tricky suggestions appreciated.
Cheers, Craig
************************************************************************
The information in this email together with any attachments is
intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material.
Any form of review, disclosure, modification, distribution
and/or publication of this email message is prohibited, unless
as a necessary part of Departmental business.
If you have received this message in error, you are asked to
inform the sender as quickly as possible and delete this message
and any copies of this message from your computer and/or your
computer system network.
************************************************************************
---------------------------------------------------------------------
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
Re: [users@httpd] Exclusion possibilities for RedirectPermanent
Posted by Joshua Slive <jo...@slive.ca>.
On 10/30/07, Robinson Craig <Cr...@nrw.qld.gov.au> wrote:
> Hi Folks,
>
> I have to redirect any requests for a particular path to another server
> for a few months, and I am successfully using:
>
> RedirectPermanent /about http://newServer/about
>
> However, an additional requirement has emerged where they want a
> sub-directory within this path to not be redirected:
>
> Eg. /about/announcements
>
> Apart from putting in individual redirects for every directory under
> /about, is there such a concept as an "exclusion list". For example,
> redirect everything under /about EXCEPT /about/announcements.
>
> Any tricky suggestions appreciated.
You can use RedirectMatch with a negative-lookahead to check for the
excluded address, but it probably easier just to use mod_rewrite:
RewriteEngine On
RewriteRule ^/about/announcements - [L]
RerwiteRule ^/about(.*) http://newServer/about$1 [R=permanent]
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