Re: [users@httpd] managing mass Apache Redirects

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

 



On 9/21/06, Julian C. Dunn <Julian_Dunn@xxxxxx> wrote:
On Thu, 2006-09-21 at 10:59 -0400, Joshua Slive wrote:

> On 9/21/06, Julian C. Dunn <Julian_Dunn@xxxxxx> wrote:
> > Does anyone have any solutions for managing a huge number of Apache
> > redirects in a manner external to Apache? What I am looking to do is to
> > store Redirect source and targets in some kind of DB. It's kind of like
> > RewriteMap but I don't actually want to use the key and values in future
> > directives.
> >
> > Ideally it would be possible to instruct Apache (either implicitly or
> > explicitly) to refresh its Redirect map without restarting Apache
> > itself.
>
> Umm... This is exactly like RewriteMap.  And RewriteMap does not need
> a restart to be refreshed.  What is it that you need that RewriteMap
> doesn't provide?

Hmm... maybe I just need some guidance with the use of RewriteMap. If a
looked-up key is not found in the map, what happens? Will Apache consult
the DocumentRoot to see if the directory exists, will the JKMounts be
consulted, etc.? I am unclear as to the order of precedence.

You specify a "default" value when you do RewriteMap lookups.  You can
then key off this default value to do whatever you want.  For example:

RewriteEngine on
RewriteMap    redirect-map  dbm:/path/to/map.file
RewriteCond   ${redirectmap:%{REQUEST_URI}|NOT-FOUND} !=NOT-FOUND
RewriteRule   ^/.*  ${redirectmap:%{REQUEST_URI}} [R]

That set of rules will redirect any request for which the request_uri
can be found in the map.file, but will ignore any other requests.
(There is probably a way to do that without requiring two map lookups,
which would be more efficient.)

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