How do I get Slim Framework to work without having to put /index.php in the URL?

I am implementing Slim Framework for PHP and everything appears to be working just fine. However, the only way I can get it to work is by putting /index.php in the URL like this:

http://www.example.com/index.php/members/1

I want it to work like this:

http://www.example.com/members/1

I have a feeling it has something to do with my .htaccess but I'm not sure. Here is my .htaccess:

RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^ ./index.php [QSA,L]
RewriteRule ^ . [QSA,L]

Answers


Restoring the commented (#) line and getting rid of the other one should help. When you downloaded Slim Framework, it originally had this in the .htaccess as well.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ ./index.php [QSA,L]

Also, you should learn about writing rewrite rules, because you won't get far without it.


I think this answer comes late, but following the information of this link http://docs.slimframework.com/routing/rewrite/ What I needed was to add the AllowOverride All statement to my virtual host configuration, and that worked for me.


Check your virtual host and allowOverRide all.

   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^ /index.php [QSA,L]

Need Your Help

Google Spreadsheet - Show sheets depending on type of user

google-apps-script google-sheets

Is there a way, to make a certain sheet in Google Spreadsheets, be editable and accessible to a certain type of user, while not be accessible to another type of user?