Re: RewriteMap and RewriteRule

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

 



On Fri, Dec 5, 2008 at 9:05 PM, Clodoaldo Pinto Neto
<clodoaldo.pinto@xxxxxxxxx> wrote:
> I'm using this config in Apache 2.2.3/Centos 5:
>
> RewriteMap redirect txt:/var/www/html/example/redirect.txt
>
> RewriteRule ^/(a|b|c|d|e)$ http://example.com/${redirect:$1} [NC,R=permanent,L]
>
> redirect.txt:
> a x
> b y
> c z
> d k
> e j
>
> Since the redirected pages are many i would like to not have to put
> them all in RewriteRule ^(a|b|c|d|e)$ using in instead the
> redirect.txt map to populate that rewrite rule. Is it possible? If not
> what else can be done?

Can you peek at the map in a RewriteCond, and stop processing if
there's no entry (^$)?  Then you would drop all the specifics in your
RewriteRule regex.

-- 
Eric Covener
covener@xxxxxxxxx

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