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 trialcrystal oakley
5,709 PointsCleaning URLs with Rewrite Rules
The challenge asks to add a rewrite rule to add a trailing slash. I can not figure this out.
RewriteRule ^(flavors/[0-9]+)$ /$1/
RewriteEngine On
RewriteRule ^flavors/$ /all_flavors.php
RewriteRule ^(flavors/[0-9]+)$ /$1/ [R=301]
1 Answer
Becky Hirsch
14,069 PointsHi Crystal! I did the RewriteRule section not too long ago and it was really hard for me to wrap my head around. You almost have it. Just remove the /[0-9]+ part and it works. So like this:
RewriteRule ^(flavors)$ /$1/ [R=301]
I hope this helps!
crystal oakley
5,709 Pointscrystal oakley
5,709 PointsWorked like a charm. Thanks!
Becky Hirsch
14,069 PointsBecky Hirsch
14,069 PointsMy pleasure! :)