0
我无法重定向到在codeigniter中使用redirect()
的页面。如果我尝试在视图内使用location.href
也是同样的问题。它只是重定向我的网页没有CSS和JS包括页面重定向问题codeigniter
我的配置
$config['base_url'] = 'http://localhost/tsb/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI'; //I have switched the 3 protocols too
的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
BOOK控制器
public function psg_sel()
{
$book_name = $this->input->post('book_name');
$book_id = $this->cj_model->get_book_id($book_name);
$ch_id = $this->input->post('chapter_id');
$cj_mask = $this->input->post('cj_mask');
if($cj_mask == ''){
$psg_sel = $this->cj_model->psg_sel($book_id, $ch_id);
if($psg_sel === true){
redirect(base_url() . 'passage/', 'refresh');
}
}
}
通道控制器
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Passage extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->database();
}
public function index()
{
$data['page_name'] = 'passage';
$this->load->view('pages/index', $data);
}
}
请帮助我不知道怎么回事。我可以直接从地址栏访问http://localhost/tsb/passage/
但这些都不将正常工作location.href="passage/";
或redirect(base_url() . 'passage/', 'refresh');
这是怎么显示
感谢这个完美工作,你知道用'location.href'问题 – Mysterio4
'location.href'上javascript.So定义尝试使用内''