开发者

CodeIgniter Escaping Clean URLs adding index.php/

开发者 https://www.devze.com 2023-03-10 17:54 出处:网络
I\'ve setup clean URLs on CodeIgniter through .htaccess and they work fine. Sometimes though CI seems to esc开发者_JAVA技巧ape it\'s clean urls and go back to index.php/ urls. So far I\'ve tracked it

I've setup clean URLs on CodeIgniter through .htaccess and they work fine. Sometimes though CI seems to esc开发者_JAVA技巧ape it's clean urls and go back to index.php/ urls. So far I've tracked it down to either:

  • Forms
  • Redirects


If you are using mod_rewrite to remove index.php from url. You need to change in config file also to make in redirect or from, urls aren't using index.php. You need change in config.php from $config['index_page'] = "index.php"; to $config['index_page'] = "";.

Please check the comments in config files above that line :)


On line 29, in config.php file:

$config['index_page'] = 'index.php';

remove the index.php, so it looks like:

$config['index_page'] = '';
0

精彩评论

暂无评论...
验证码 换一张
取 消