Mark
Mark

Reputation: 97

Redirection Issue With Codeigniter

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

Answers (3)

Raja Ram T
Raja Ram T

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

Ahmed iqbal
Ahmed iqbal

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

Ankit Pise
Ankit Pise

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

Related Questions