Without changing my patterns to match the whole string (which would make them a lot more complicated), is there a way to use the current URI in the substitution string?

Using %{REQUEST_URI} won't work, as that uses the original URI.

  • Why would it make them more complicated? Can you provide an example? Jun 24, 2013 at 16:00
  • I only mentioned it because I want an answer to the question, not for someone to suggest the work-around that I already know.
    – OrangeDog
    Jun 25, 2013 at 9:26

1 Answer 1


I guess what I'm saying is that switching from something like..

RewriteRule ^/some/path/(.*)\.html$ /$1/


RewriteRule ^(/some/path/(.*)\.html)$ /$2/?fullurl=$1

..isn't really very burdensome.

The question you asked doesn't have a solution; there's no special variable that holds the string being matched against in RewriteRule, since you already have that string available to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.