【发布时间】:2012-12-04 23:51:06
【问题描述】:
我已经为此工作了一个小时,所以我想我不妨问问。
我正在尝试从我的 CodeIgniter 应用程序的 URL 中删除 index.php,但无法做到。
该应用程序在我办公室的专用服务器上运行,我通过 URL http://smr_local 访问该应用程序
这是我的基本虚拟主机块
<VirtualHost 192.168.1.90:80>
ServerAdmin admin@server.com
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
我真的不知道接下来该尝试什么。任何帮助将不胜感激。
【问题讨论】:
标签: apache codeigniter