Welcome Guest, Not a member yet? Register   Sign In
[$config['index_page'] = ""] still requires index.php in url
#9

[eluser]Kamape[/eluser]
[quote author="ZeGerman" date="1247415201"]Hey man,

I am relatively new to CI, however I have been working with PHP for a considerable amount of time now. I am not sure whether this is the correct solution. However, you should look at some examples of how to use the .htaccess or mod_rewrite to rewrite your urls.

Instead of setting your $config['index_page'] to null, leave on index.php. You need to change the way your rewrite rule works:

This is simply an example of what I would do in the .htaccess file
*******************************************************************
Options +FollowSymLinks
Options +Indexes
RewriteEngine On

RewriteRule ^(.*)$ index.php?/$1 [L] // THE KEY IS THAT YOU WANT TO REWRITE ANY REQUESTS MADE TO THE INDEX SCRIPT, HENCE THE ^(.*)$ , FETCH THE REQUEST AND PARSE IT TO THE index.php? URI.

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*) index.php?r=$1 [QSA,L]
**********************************************

I cannot guarantee that this is the solution, however, if this does not work the first time try and look up some mod_rewrite tutorials, they should give plenty of examples on how to do this properly.


Kind Regards
ZeGerman[/quote]

The problem isn't in that area though, cause when adding 'index.php' to $config array, the index.php is printed on any of the anchors create by the site_url() helper.

You instead want to REMOVE the index.php from your anchors and INSERT it in your .htaccess file. I'm not sure but in your example i'll guess an URL to www.example.com/index.php/show/page would route to www.example.com/index.php/index.php/show/page

The problem here i'll think relays in the php server configuration or something like that.


Messages In This Thread
[$config['index_page'] = ""] still requires index.php in url - by El Forum - 07-12-2009, 06:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB