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 Building Websites with PHP Slim Basics & Twig Templates Including & Running Slim

Matthew Panton
Matthew Panton
15,228 Points

using WAMP

I'm working on this project locally using WAMP and I get a '500 Internal Server Error' when I use the .htaccess file. What's going wrong?

2 Answers

Randolph Judy
Randolph Judy
Courses Plus Student 28,198 Points

I am using XAMPP and I can just run this code if I put this project in the root directory for my server, which is htdocs. It would not work in the folder I created in my usual work space which is in a sub directory of htdocs. This is a not a PHP problem because I can run other PHP programs with no problem. You might be able to modify the .htaccess file to make it work in a sub directory on your system, but this could cause other problems. If the program will not work in your server's root directory, check the documentation on how to configure it to allow the use of .htaccess files.

Oliver Gibbs
Oliver Gibbs
9,771 Points

Could you post the contents of your .htaccess file? The error just indicates that something's wrong in that file. If you're using .htaccess to rewrite links make sure it starts with

RewriteEngine On