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 trialKaran Jindal
Courses Plus Student 1,406 PointsRedirection Loop after setting up RewriteRule
Hey, When i changed the .htaccess file to convert url from http://shoutwp.com/user.php?u=kavish to http://shoutwp.com/kavish The Webpage is giving an error of redirect loop
My .htaccess file looks like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^([a-z0-9]+)/$ user.php?u=$1
RewriteRule ^([a-z0-9]+)$ /$1/ [R=301]
RewriteCond %{QUERY_STRING} ^u=([a-z0-9]+)$
RewriteRule ^user.php$ /%1/? [R=301]
</IfModule>
1 Answer
Tyrell Jentink
8,415 PointsI'm pretty sure you need a RewriteCond before the first two rewrite rules.
Karan Jindal
Courses Plus Student 1,406 PointsKaran Jindal
Courses Plus Student 1,406 Pointswhat cond?