Mariusz Handke wrote:
This wouldn't work (RewriteCond) since $2 and $3 are not known at this stage of rewriting process yet, but I'm still working on it
- That won't work. You can't use back references from mod_rewrite in a RegEx.
- They're known, as Axel-Stéphane already said.- You must use a kind of tricky solution using a regEx internal back reference.
- Why are you using a <Location> container at all?So you expect /test/file.html to be rewritten to /test-redir.php?page=/test/file.html
expecting per-server context (in other words: main server config section or in a <virtualhost>, if you're using virtual hosts:
RewriteEngine On RewriteCond %{HTTP_REFERRER}<>$1 !(/test/.+)<>\1$ RewriteRule ^(/test/[^/]*\.(html?|php))$ /test-redir.php?page=$1 [L,NS] -- Robert --------------------------------------------------------------------- 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