我想要我的URL看起来像这样:www.domain.com/controller/view/args而不是index.php?/controller/view/args。实际上,我从未希望"url index.php?..."有效。有人能给我提示如何强制执行此行为吗?因为当我执行以下操作时:A)redirect()或B)手动键入"index.php" "..." URL会更改为那个丑陋的模式。
这是我的config.php文件:
这是我的.htaccess文件(我不知道是否需要此文件,只是从互联网复制+粘贴):
#http://codeigniter.com/wiki/Godaddy_Installaton_Tips/
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
这是我的config.php文件:
$config['base_url'] = '';
$config['index_page'] = 'index.php?';
$config['uri_protocol'] = 'AUTO';
$config['enable_query_strings'] = FALSE;
以下是导致行为改变的内容:
redirect('...blah', 'either location or refresh');