httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] Redirect using RewriteMap and notice via SSI?
Date Sat, 07 Aug 2004 15:32:16 GMT
On Sat, 7 Aug 2004 01:26:07 -0500, Jerry A. Copus <> wrote:
> Based on entries that I want to rewrite in a RewriteMap text file:
> Rewrite to
> Rewrite to
> ....and in both cases include a notice block at the top of the
> corresponding target index.html file that "You're using an old URL
> (oldurl). The new URL is (newurl)." Also, throwing the proper redirect
> response code (302 or 301) in the process....

Your idea of using an env variable will not work because env variables
are request specific and won't be passed through a redirect.  But you
could use a query string instead.  Something like this (completely

RewriteEngine On
RewriteMap legace txt:/path/to/legacy.txt
RewriteCond %{REQUEST_URI} ^/~([^/]+)(.*)
RewriteCond %{legacy:%1|NOT-FOUND} !=NOT-FOUND
RewriteRule ^/~.* /%{legacy:%1}%2?legacy [R=permanent]

Then you test the QUERY_STRING for "legacy" in the target document to
see if you need to display the warning at the top.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message