how to prevent redirect function adding index.php to urls |
I'm using the CI function redirect in my web app. The problem I'm having is that if I redirect a user to /some/path/internally, then the redirect function inserts "index.php" into the url it redirects to. For example I created a controller Test:
Code: class Test extends CI_Controller { Code: http://example.com/index.php/some/path/internally Code: http://example.com/some/path/internally Code: /some/path/internally Is there some configuration setting I'm missing or something? (01-11-2015, 03:59 PM)sneakyimp Wrote: I'm using the CI function redirect in my web app. The problem I'm having is that if I redirect a user to /some/path/internally, then the redirect function inserts "index.php" into the url it redirects to. For example I created a controller Test: apache mod_rewrite .htaccess ![]() (01-11-2015, 06:06 PM)Wei Wrote:(01-11-2015, 03:59 PM)sneakyimp Wrote: I'm using the CI function redirect in my web app. The problem I'm having is that if I redirect a user to /some/path/internally, then the redirect function inserts "index.php" into the url it redirects to. For example I created a controller Test: application/config/config.php: $config['index_page'] = "" // => remove "index.php"
And... to promote myself (again...): http://avenir.ro/codeigniter-tutorials/r...ndly-urls/
Website: http://avenir.ro
site_url() adds index.php to the url use base_url() to get rid of it.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(01-12-2015, 04:52 AM)InsiteFX Wrote: site_url() adds index.php to the url use base_url() to get rid of it. That will happen only if config['index_page'] has 'index' as value. Website: http://avenir.ro
|
Welcome Guest, Not a member yet? Register Sign In |