My question is much similar to this one: Default GET route with Slim PHP But I have a query: Whenever I try to access (localhost/mySite), instead of executing the mapped function (mapped to '/'), I get the directory structure of my folder. Now that is pretty obvious as I don't have any index file in my site folder. The function doesn't even gets called. Is there anyway to do this? Thanks.
Asked
Active
Viewed 65 times
0
-
Do you have properly setup your htaccess? – danopz Nov 26 '15 at 13:14
-
And by 'properly', what do you imply? All my other mappings are working just fine. Gets routed to my routes.php successfully, if that's what you're trying to say. – AnkitNeo Nov 26 '15 at 13:41
-
Are you on Apache? If yes, can you add your `.htaccess` file? – Davide Pastore Nov 26 '15 at 16:33
1 Answers
0
If you don't want to rename routes.php
to index.php
you could overwrite your DirectoryIndex for that directory:
#.htaccess
#…rewrite stuff
DirectoryIndex routes.php
With this method you tell your Apache that routes.php
actually is the index.

danopz
- 3,310
- 5
- 31
- 42