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 Enhancing a Simple PHP Application Paginating a List: Model and View Understanding Comments

Project Files not working for me

I ran through the first PHP project in the track and wanted to see how the whole project looks at the end of this course. Oddly enough, I copy the project into MAMP's htdocs (I moved shirts.php into the home directory per others' reports) and when I click on a shirt either on the home or in the catalog, I get a 404 error:

"Not Found

The requested URL /shirts/101/ was not found on this server."

It's strange because this works fine on the version I made with the Building a Simple PHP Application course. Is this a problem with the project files for the second PHP course?

3 Answers

have you changed the location where MAMP is pointing?

Mamp -> Preferences -> Apache

Then select the appropriate document root from the file tree. This is quite nice because you won't have to clog up a single htdocs folder. The document root you're after is wherever the home page 'index.php' file is sitting.

I have this set up correctly. index.php is in htdocs without any other index files.

Mac HD -> Applications -> MAMP -> htdocs

Are you not able to replicate the same issue I'm experiencing?

Everything else works fine except the shirts detail page.

Konrad Pilch
Konrad Pilch
2,435 Points

I got the same problem.

If you have your .htaccess file, can you post it?

Use the 'Markdown Cheatsheet' to see how to format it.

Konrad Pilch
Konrad Pilch
2,435 Points

.htaccess file ? What is this? what do you mean?

In the root of your project where your index.php file is sitting (aka the home page), is there a file named '.htaccess' at the same level?

Ge W
Ge W
4,992 Points

The .htaccess file does not work in my current version of MAMP, despite the effort to turn override on in Apache configuration file. I then have to modified the urls to make it work without .htaccess overwrite rules. The urls in the project files linking to shirts.php (and shirt.php) also contain minor mistakes. And this can be rectified by adding directory name shirts/ before each of the corresponding shirt(s) urls.