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

Issue with rewrite rules (localhost)

I am working on a local project and i'm having a problem setting up Rerwrite Rules.

I am doing the project for Enhancing a Simple PHP application, and i've added an .htaccess file, confirmed XAMPP apache is setup for modrewrite in its config files, etc. But i'm still having a problem.

The rule in my .htaccess file should load the page (/shirts/shirts.php) when the following address is entered: localhost/shirts/

    RewriteEngine On
    RewriteRule ^shirts/$ /shirts/shirts.php

The .htaccess file is located in the root folder (htdocs directory).

Any help would be appreciated.

1 Answer

the character for ^ gave me a lot of trouble on that one... make sure you type it with shift+6 and make sure to type a space after it. That did the trick for me.