On Fri, 1 Jun 2007 15:22:19 -0400
"Joshua Slive" <[EMAIL PROTECTED]> wrote:

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

Thanks - this was the ticket.  I figured I'd post the final solution
in case someone else ever finds this thread:

First block - handles rewriting new URL's to existing pages on the
filesystem:  my/new/url.php => sitepages/pid123.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* ${smc_rewriter:%{REQUEST_FILENAME}^%{REQUEST_URI}}
[L,QSA,NS]

Second block - redirects anyone that still uses the old URLs to the
new page names:  sitepages/pid123.php => my/new/url.php (301 redirect)

RewriteCond %{THE_REQUEST} sitepages/p.*.php [OR]
RewriteCond %{THE_REQUEST} store/p.*.php
RewriteCond %{THE_REQUEST} !redirect_to_new_url=yes
RewriteRule .*
${smc_rewriter:%{REQUEST_FILENAME}^%{REQUEST_URI}}?redirect_to_new_url=yes
[R=301]

Thanks for your help, so far this is being well-received and the
performance seems pretty good (certainly better than hundreds of
rewriterule's in a .htaccess).

Josh

---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to