0

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.

Community
  • 1
  • 1
AnkitNeo
  • 122
  • 1
  • 11

1 Answers1

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