Reputation: 97
I am Uresh.I have issue with page redirection with server.(LINUX SHARED SERVER)
I have front-end of web site. I have superadmin panel. I have developer panel. Means three types of users will use my site. This is my directory path.
CONTROLLERS
-> application\controllers\ = front end controllers
-> application\controllers\admin = superadmin controllers
-> application\controllers\developers = developers controllers
SAME IN VIEW FILES
-> application\view\ = front end controllers
-> application\view\admin = superadmin controllers
-> application\view\developers = developers controllers
I am attaching my “.htaccess” file along
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
Please anyone can guide me !!!
Thank You in Advance
Upvotes: 0
Views: 1663
Reputation: 864
hey Uresh redirect() using this we can redirecting in codeigniter it is the url helper you should be load the
$this->load->helper('url');
other wise you can put in the 'config/autoload.php'
$autoload['helper'] = array('url');
example:
$logged_in = your session data
if ($logged_in == FALSE)
{
redirect('/controllers/admin');
}
url helper link get the helper
Upvotes: 0
Reputation: 597
First you need to make sure, 'config/autoload.php'
$autoload['helper'] = array('url');
then you can redirect easily with
redirect('/your-redirect-path/', 'refresh');
Upvotes: 1
Reputation: 1259
Can't figure out your issue but if you want to redirect, load url helper with
$this->load->helper('url');
& redirect user with
redirect('Desired URL OR Controller/function');
For more information, follow codeigniter documentation.
Upvotes: 0