Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?

what's the use of back references in Rewriterule in mod_rewrite?

share|improve this question

marked as duplicate by Chris S, Iain, Ben Pilbrow, Scott Pack, Ward Feb 16 '11 at 20:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

See this for excruciating details:

Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?

Backreferences are used to address specific match-groups in RewriteRule segments.

RewriteRule ^/blog/(2008|2009)/(.*)$   /newblog/$1/$2

(2008|2009) is a reference, and $1 is the backreference. Same for (.*) and $2. As you can see, they're used for URL rewriting. See the "RewriteRule matching syntax" section of the answer I linked to.

share|improve this answer

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