【发布时间】:2016-06-19 22:16:56
【问题描述】:
我正在为我的网站使用 codeigniter v3,但在从一个页面重定向到另一个页面时遇到问题。
如果我点击选项卡,链接会显示localhost:8080/IDS/view/decisiontree 并显示Object not found! The requested URL was not found on this server...
如果我编辑 URL 并将其设为 localhost:8080/IDS/index.php/view/decisiontree,则该站点将完美加载。
这是我的路线:
$route['view/decisiontree'] = 'data_controller/goto_decisiontree';
以下是相关标签的代码:
<li><a href="<?php echo base_url();?>view/decisiontree">Decision Tree</a></li>
这是我的数据控制器:
public function goto_decisiontree(){
$data['page'] = "2";
$this->load->view('decisiontree_page', $data);
}
这是我的config.php:
$config['base_url'] = 'http://localhost:8080/IDS';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
这是我的 .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
请注意,我使用的是 Codeigniter V3。
非常感谢您的帮助!
【问题讨论】:
-
只是在base url末尾的注释提出斜杠
/$config['base_url'] = 'http://localhost:8080/IDS/'; -
你使用的是 wamp 还是 xampp 等?
标签: php .htaccess codeigniter xampp