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


Rewrite rules not working for me

I am using Mac OS X Mavericks to complete the PHP track. I am not using MAMP, so I am relying on the OS X Apache install and the settings in /private/etc/apache2/httpd.conf

I wrote the rewrite rule as shown on the video and when I go to the shirts directory I am not redirected to the shirts.php page. I installed MAMP in a VM running Mountain Lion and the rewrite rule did not work there either. I even tried writing the rewrite rule directly in the httpd.cong file instead of .htaccess and that didn't work either. Can I get some help? I should also mention that I also tried changing my server document root to The Sites folder in my home directory. It made no difference.

1 Answer

I placed my .htaccess file in my shirts4mike website root rather than my server root, and that fixed the error. I should note that, form the beginning, I had placed the website for this project in its own directory instead of the server root in order to keep a a cleaner server directory.