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

Mostafa Akram
Mostafa Akram
Courses Plus Student 9,541 Points

URL still not found Slim

I am working on my local host on my mac

i have done all the steps by adding .htaccess file to the directory of my project

and added the code from Get Started of the Slim Framework v2

and when typing localhost/myproject/hello/name still didn't get anything and receive Not Found on server error

although i have done it on the workspace and it worked fine

Mostafa Akram
Mostafa Akram
Courses Plus Student 9,541 Points

although $app->get('/',function() {}); worked fine but $app->get('/contact',function(){});did not work

2,685 Points

Sounds like .htaccess problem. what is your base path? try this inside your get() before return line.


if the path not equal '/' than add RewriteBase /to/your/path in .htaccess.


PS. I am under Slim 3