Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdam Zuckerberg
22,248 PointsWhat is the difference between $ and % in a backreference?
I am confused. In one case in the rewrite rules, it looks like Andy uses /%1/ as a backreference but in the other one (and in the code challenge) he uses /$1/.
What is the difference between $ and % in a backreference?
1 Answer
Bob Hensley
26,781 PointsBoth are backreferences, but for different sources. The dollar sign ($1-9) refers to RewriteRule. And the percentage sign (%1-9) refers to RewriteCond. It's just mod_rewrite's way of removing confusion about what the backreference is meant to actually reference.
Adam Zuckerberg
22,248 PointsAdam Zuckerberg
22,248 PointsThank you!