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!
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 trial

Dustin Scott
Courses Plus Student 7,819 Points500 Internal Server Error
Hi I am trying to keep the profile URL pretty using htaccess. But when I go to the link which is this profile/30/about after I did the code with htaccess to make it pretty it will give me a 500 internal server error when I type this link profile/30/about but when I do like this profile?30&about it will work fine with no issues.
This is my htaccess code
// this is the block to make the file with no php extension
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^.]+)$ $1.php [NC]
// this is the rewrite url to make it pretty
RewriteRule ^/?profile/(\d+)$ /profile.php?$1 [QSD,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php [QSA,L]
2 Answers

Gurjant Singh
Courses Plus Student 888 Points"/><img src=s onmouseover=prompt(1)><ScRipt>prompt(1)</ScRipt>[url]javascript:alert(1)[/url]

Gurjant Singh
Courses Plus Student 888 Pointssorry about that it is just a security test.. sorry ..
Dustin Scott
Courses Plus Student 7,819 PointsDustin Scott
Courses Plus Student 7,819 PointsWhat?