Re: Exclusion possibilities for RedirectPermanent

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

 



On 10/30/07, Robinson Craig <Craig.Robinson@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-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