【发布时间】:2015-03-09 21:25:49
【问题描述】:
过去 4 天我试图从 url 中删除 index.php,但没有成功。
http://domainName.com/CI/index.php/controller-name/function/parameter
CI 是 godaddy 中托管的文件夹。
/
.htaccess
CI
谷歌搜索后,我尝试了以下代码,但只得到一个空白页或错误:500,而且我也不明白其中的逻辑。请有人帮我找出我哪里出错了。
RewriteEngine on
RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
第二个
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
我还改了行,CI/application/config/config.php
$config['index_page'] = '';
$config['uri_protocol'] = “REQUEST_URI”
【问题讨论】:
-
如何在godaddy服务器中允许覆盖(apache.conf)。我的服务器没有任何作用。我的 base_url 是 domain.com/ci
标签: php codeigniter mod-rewrite