This is a work-in-progress.
There is no evidence that there is any Apache server configuration in my system to enable CodeIgniter to use segment based URLs. So, how come Apache is able to use segment based URLs on my system?
None of the
.htaccess files in the CI download directory have anything that would alter the way Apache interprets URLs. And, I don’t recall making any changes to Apache configuration files related to this. Who knows? Maybe Apache (by default) can handle segment based URLs.
First, I’ll go back and take a look at the steps I followed when installing CI. Nope, nothing there.
Next, I went and re-read part of a book I had bought. It indicated that this kind of thing is done using the Apache
RewriteEngine On and
RewriteRule configuration directives. Those directives were used to convert from a segment based URL to standard URL GET query string—i.e.
Let me take a look at my Apache configuration to see if such a thing is used.
RewriteEngine set of directives I’ve found in my system are the ones I put in the
.htaccess file in my CodeIgniter’s install directory next to
This is the assumption I’ll be making:
When Apache sees a segment in the URL which looks like a file name (i.e.
index.php) it looks for a file with that name in the corresponding directory—where it would be. If it finds a file with that name it assumes all the segments which follow it in the URL are GET parameter values which are to be passed to that web page file.
The only place which I have found that talks about a need for the rewriting of the URL to transform it from segment based to GET style was the book I read. The rest of the people on the Web only talk about using rewrites to get rid of the
index.php file name from URLs. See my post about the directives for doing this.