URL を次のようにしたい: index.php?/controller/view/argsではなくwww.domain.com/controller/view/args。実際、 「 index.php ?...」という URL を検証したくありません。A) redirect()またはB)手動で「index.php」と入力すると、"..." URL がその醜いパターンに変わります。
これは私の .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');