我一直工作在這一個小時了,所以我想我還不如問刪除的index.php。與笨的.htaccess
我想從我的CodeIgniter應用程序的URL中刪除index.php文件並不能做到這一點。
應用程序是在我的辦公室在專用服務器上運行,我通過URL http://smr_local
訪問應用程序這是我的基本虛擬主機塊
<VirtualHost 192.168.1.90:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/smr.dev/app"
ServerName smr_local
ErrorLog "/etc/httpd/logs/error_log"
CustomLog "/etc/httpd/logs/access_log" common
<Directory /var/www/smr.dev/app>
Order allow,deny
Allow from all
AllowOverride All
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine on
</IfModule>
</VirtualHost>
這裏是我的.htaccess文件
RewriteEngine on
RewriteBase/
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
而且我的配置文件
$config['base_url'] = "http://smr_local/";
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
現在,當我試圖訪問我的基本URL http://smr_local/user/courses
我得到了我的Apache的錯誤日誌中的錯誤我得到這個。
File does not exist: /var/www/smr.dev/app/user
我真的不知道接下來要做什麼。任何幫助,將不勝感激。
是的,那是我第一次嘗試。不起作用。 – nicks451
@ nicks451我已經更新了答案,請看看。 –