For some reason I can't spot, redirect in codeigniter is not working. I'm getting the white screen of death.
I set up a "test" controller:
class Test extends Controller {
function Test() {
parent::Controller();
$this->load->helper('url');
}
function index() {
redirect('home','refresh');
}
}
(I've tried the location and refresh parameters, with no help).
Here's my .htaccess file:
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
I've used all this before with good results. Anything else I can check?
Thanks.
John
As it turned out, setting the log threshold to 4 was the answer to figuring this out. I was able to determine that I was outputting some space, which prevented the redirect from working. Looking in the logs revealed this.
Thanks everyone for your help, and thanks Madmartigan for suggesting the log setting.
Try adding a ? at the end of index.php in your last rewrite rule as such:
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]
If that doesn't work, try changing your $config['uri_protocol']
(if it's set to AUTO
) to:
$config['uri_protocol'] = 'REQUEST_URI';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With