Welcome Guest, Not a member yet? Register   Sign In
why is www.mydomain.com/index.php/reports/report1 mapped to index.php ?


the title says it all. I must have spend 3 hours to find and answer to this question on the internet - I surrender and signed up on this forum to ask Smile

I started working on a project which uses apache2 (with the virtual hosts mod - but i think that doesn't matter) and a standard codeigniter setup. In the DocumentRoot directory is the codeigniter index.php file.

Why is a request like "www.mydomain.com/index.php/reports/report1" not interpreted by apache as try to find in DocumentRoot a directory called "index.php" and in there a directory "reports" and in there a file called "report1".

Everything works fine by the way: the index.php file is called and does its magic.
But out of pure curiosity I would like to know ... why is that ? Smile



[eluser]Harold Villacorte[/eluser]
You probably have index.php defined as DirectoryIndex in either httpd.conf or .htaccess.

yes there is an entry in httpd.conf (and only there):

<IfModule dir_module>
DirectoryIndex index.php index.html

However the docu says :"The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name." Hmm .. if I request www.mydomain.com/index.php/reports/report1 should I not request the directory "index.php/reports/report1/" which doesn't exist and that should return a "file not found error" ?

[eluser]Harold Villacorte[/eluser]
CI has a couple of nifty classes called uri and router. Together they grab the uri from the $_SERVER superglobal and serve up code based on the uri segments like this - index.php/controller/method/parameter/.

Theme © iAndrew 2016 - Forum software by © MyBB