针对apache,支持mode_rewrite可以通过在目录先建立.htaccess去掉url中index.php

.htaccess内容如下:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f   #这个重要,保证css,js正常加载

RewriteCond $1 !^(index\\.php|images|robots\\.txt)

RewriteRule ^(.*)$ /index.php/$1 [L]

然后找到application/config/config.php文件:

将$config['index_page'] = "index.php";改为$config['index_page'] = "";

相关文章:

  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
猜你喜欢
  • 2021-06-19
  • 2021-06-19
  • 2021-05-16
  • 2021-10-23
  • 2021-10-24
  • 2022-12-23
  • 2021-10-04
相关资源
相似解决方案