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 trial

PHP

PHP & MySQL Tutorial

Hi Guys,

This is probably an easy Q.

Every time i click the shirts link on the Shirts for mike website, it sends me to this page and then i have to click the bottom link where it displays the correct page:

http://imgur.com/KwQ9Ix2

Does anyone know why this happens?

Thanks

1 Answer

This is happening because by default the server will look to display a index file. Since there is currently no index file inside of the shirts folder it doesn't know what to display. You can fix this by either changing the name of one of the folders to index.php (although this is not recommended) or you can fix it by using Rewrite Rules in order to tell it to display one of those two files you have by default.

Check this series of videos out for reference http://teamtreehouse.com/library/enhancing-a-simple-php-application-2/cleaning-urls-with-rewrite-rules/introducing-rewrite-rules-3