我正在爲我的網站使用codeigniter v3,並遇到從一個頁面重定向到另一個頁面的問題。PHP - Codeigniter URL無法在沒有index.php的情況下工作 - 找不到對象
如果我單擊該選項卡,鏈接顯示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>
這裏是我的data_controller:
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>
,並注意,我用笨V3。
非常感謝您的幫助!
只是說明在基本URL的提出結束斜線'/''$配置[ 'BASE_URL'] = '的http://本地主機:8080/IDS /';' – user4419336
你使用的是wamp還是xampp等? – user4419336