redirect not working |
Hi,
my redirect function to admin dashboard is not working but it was working yesterday i have tried every thing in .htaccess and config and route files i dont know what to do? is it need to update codeigniter ?
There must be some kind of change on your script/server so something working yesterday not to work today.
How ever if you want help you have to show us your code where the bug is coming out else how the hell we can know what is causing it ? Best VPS Hosting : Digital Ocean
this is my htaccess :
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond $1 !^(index\.php|images|img|js|sexyimages|media|roleimages|lang|uploads|files|profile|audio|video|videoplayer|talentimages|captcha|gmap|timthumb|include|ckeditor|webfonts|player|robots\.txt|css|sitemap\.xml|sitemap\.html|BingSiteAuth\.xml) RewriteRule ^(.*)$ ./index.php/$1 [L] </IfModule> and this is my admin login code <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Home extends CI_Controller { function __construct() { // Call the Model constructor parent::__construct(); $this->load->model('admin/adminloginmodel','', TRUE); $this->load->library('session'); } public function index() { //$objResponse=new xajaxResponse(); $this->load->helper('url'); $data['msg']= ''; if(isset($_POST['submit'])) { $msg=$this->adminloginmodel->check_adminlogin(); //echo $msg; if($msg != 'success') { //redirect('admin/dashboard', 'refresh'); $data['msg']= $msg; } else { redirect(site_url('admin/dashboard')); } } $this->load->view('admin/adminhome_view',$data); } } /* End of file home.php */ /* Location: ./application/controllers/home.php */ Code: <IfModule mod_rewrite.c> What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
i tried your code its now showing 404 not found error
before it was loading the admin login form but the redirecting to dashboard after that showing empty page actually all login forms not working on the website
i see that your redirect is commented
PHP Code: //redirect('admin/dashboard', 'refresh'); maybe that is the problem? Website: http://avenir.ro
(12-08-2014, 01:09 PM)hadeel Wrote: I tried that also still not working Replace this in your controller PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); And this in your .htaccess file Code: <IfModule mod_rewrite.c>
Romanian CodeIgniter Team :: Translations :: Comunity :: Developers
http://www.codeigniter.com.ro
i have tried your code still same problem and if changed the .htaccess all pages will be not working
For a redirect on your own server you dont need a url function. just write it in that way
PHP Code: old code In your /application/controllers you must hava a Admin.php with a dashboard method. |
Welcome Guest, Not a member yet? Register Sign In |