我試圖從url中刪除index.php過去4天,但沒有成功。在codeigniter中刪除index.php -htaccess
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 /應用/配置/ config.php文件
$config['index_page'] = '';
$config['uri_protocol'] = 「REQUEST_URI」
試試這個: HTTP://計算器.com/questions/14783666/codeigniter-htaccess-and-url-rewrite-issues/14807463#14807463 –
如何在godaddy服務器中允許override(apache.conf)..在我的服務器中什麼都不起作用。我的base_url是http://domain.com/ci/ –