Redirect without index.php being prepended |
[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
[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="<?php echo base_url(); ?>login">Login</a> Good luck
[eluser]Alias M2K[/eluser]
I think your problem is solved in the documentation. ![]() Check out the heading: Removing the index.php file here: CodeIgniter User Guide |
Welcome Guest, Not a member yet? Register Sign In |