On 6/1/07, Josh Trutwin <josh@xxxxxxxxxxxxxxxxxxx> wrote:
On Fri, 1 Jun 2007 08:57:06 -0400 "Joshua Slive" <joshua@xxxxxxxx> wrote: > I can't tell at all what you are trying to accomplish here. Given > you have the second set of rules, why is the first set of rules > necessary at all? If people are redirected to the correct place, > why do you then need to remap internally? Sorry - the first block was meant to map/rewrite new URLs to existing pages that all have the form sitepages/pid123.php - for example: features.php => sitepages/pid123.php This is a rewrite because features.php does not actually exist on disk but maps to the file sitepages/pid123.php. The second block then is meant to serve as a redirect. Basically the management wants to make sure that anyone who still uses the old URL scheme gets redirected to the new URL - so when someone browses to: sitepages/pid123.php they get a redirect to features.php - which then has to do the mapping. Yeah it's kind of strange, but that's what the customer wants I guess. From discussions on the mailing list previous to this I added the "redirect_stop=yes" to the query string to prevent infinite redirect loops. I have one mapping program that uses on map array: 'features.php' => 'sitepages/pid123.php', 'sitepages/pid123.php' => 'features.php', So both rules can use the same RewriteMap, but I think I need two rules because one is a 301 redirect and the other is not.
Using the same map for both directions was what confused me. There are a number of ways to get around this problem. Moving to httpd.conf is always preferable in my opinion. But you could also try replacing your REQUEST_FILENAME test with a test against REQUEST_URI or THE_REQUEST. Since these should always have the original request data in them, they won't be affected by the previous rewrite stuff and therefore will only match for requests that are explicitly requesting the old names. Alternatively, you could have your first set of rewrites add a ?rewritten to the query string and test against that. Finally, you really need to fire up the RewriteLog to help you debug this stuff. 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