Welcome Guest, Not a member yet? Register   Sign In
Redirect without index.php being prepended
#1

[eluser]domainsvault[/eluser]
Ok, I have several cases where I am using redirect() or equivilant with javascript [removed]() either way.. when this occurs my url goes from

domain.com/login
to
domain.com/index.php/home

(example of use from a login page to the home page) is there a way to redirect() or point with javascript (which ever case is the serving point at the time) to not have it automaticly add index.php to the URL currently I am using .htaccess to avoid the index.php being in the URL like that

i am redirecting usually like this

redirect('./') to go back to the main page from where ever..
reditrec('./home') when I am being specific
#2

[eluser]xerobytez[/eluser]
If you are using .htaccess to remove index.php then you should open up /application/config/config.php and change

Code:
$config['index_page'] = 'index.php';

to:

Code:
$config['index_page'] = '';

Another option would be to use the base_url(); function which gives the base path to your site. So you could do
Code:
<a href="&lt;?php echo base_url(); ?&gt;login">Login</a>
to point to http://yoursite.com/login

Good luck
#3

[eluser]Alias M2K[/eluser]
I think your problem is solved in the documentation. Smile
Check out the heading: Removing the index.php file here: CodeIgniter User Guide




Theme © iAndrew 2016 - Forum software by © MyBB