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 Clean URLS

After I download the Mike's Shirts site into my htdocs folder, the site navigation works perfectly. However, when I move the entire site to a subdirectory and I modify the config.php file to include a subfolder (shown below), the contact and search pages appear properly, but the shirts and shirt details pages break. The page, for example, is localhost/project2/shirts and the error I get is Object not found. The htaccess file seems to have the correct rewrite rules. What step am I missing?

define("BASE_URL","/project2/"); define("ROOT_PATH",$_SERVER["DOCUMENT_ROOT"] . "/project2/");

1 Answer

Hey! If this is still not working for you, you could try clearing your internet browsing history. That has worked for me quite a few times.

Another possibility is that some of the files aren't including via the relative root i.e. they're missing ROOT_PATH.