Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Enhancing a Simple PHP Application Cleaning URLs with Rewrite Rules Get Variables and Rewrite Rules

Prakhar Patwa
Prakhar Patwa
11,260 Points

still displaying full url for particular shirt info

shirt page which displaying all shirts, file name is shirt.php https://jsbin.com/caxuvicuve/edit?html,output

shirt information for particular shirt file name is shirtInfo.php https://jsbin.com/mewuvikure/edit?html,output

.htaccess file RewriteEngine On RewriteRule ^shirts/$ shirts/shirt.php RewriteRule ^shirts/([0-9]+)/$ shirts/shirtInfo.php?id=$1

Problem: still showing the full url for particular shirt information, Please help me out

paste your .htaccess file here

Prakhar Patwa
Prakhar Patwa
11,260 Points

RewriteEngine On RewriteRule ^shirts/$ shirts/shirt.php RewriteRule ^shirts/([0-9]+)/$ shirts/shirtInfo.php?id=$1 RewriteRule ^contact.php$ contact/ [R=301] RewriteRule ^shirt.php$ shirts/ [R=301]

RewriteRule ^(shirts/[0-9]+)$ /$1/ [R=301]

RewriteCond %{QUERY_STRING} ^îd=([0-9]+)$ RewriteRule ^shirtInfo.php$ /%1/? [R=301]