Welcome Guest, Not a member yet? Register   Sign In
using redirect() but it's displaying index.php in the url
#1

[eluser]ehicks727[/eluser]
Hi all.

I'm using redirect(), and it's actually redirecting, but it's leaving index.php in the url.

A couple of things to note... I'm using XAMPP right now (dev), and mod_rewrite is working great, except for this problem.

Here's what I start with...
http://localhost:83/quote

I do redirect('/quote/step2', 'location'); and I end up here...
http://localhost:83/index.php/quote/step2

Any ideas how I can get rid of the index.php in the url??

Thanks.
#2

[eluser]Lone[/eluser]
What do you have set in your 'application/config/config.php' file for $config['index_page']?

It should read as:

Code:
$config['index_page'] = "";
#3

[eluser]ehicks727[/eluser]
[quote author="Lone" date="1210321271"]What do you have set in your 'application/config/config.php' file for $config['index_page']?

It should read as:

Code:
$config['index_page'] = "";
[/quote]

That was it! I had $config['index_page'] = "index.php";

That kind of begs the question... why does having index.php in that config parameter effectively hide the index.php in the url all the time, except for using the redirect() function?? This question is purely for my education only... I'm still learning CI and I find myself just doing things, or following instructions in the forum without necessarily knowing why it works.

Thanks!!!
#4

[eluser]ehicks727[/eluser]
I guess it helps if I read the notes in the config.php file..

"If you are using mod_rewrite to remove the page set this variable so that it is blank."

I get it... mod_rewrite takes care of it so CI doesn't need to... or something like that.

Thanks again for your help... CI forum users save the day again!




Theme © iAndrew 2016 - Forum software by © MyBB