如何在不使用index.php的情况下配置ThinkPHP5?

更新于
2026-09-22 21:55:56
0阅读来源:SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计445个文字,预计阅读时间需要2分钟。

如何在不使用index.php的情况下配置ThinkPHP5?

删除tp5的index.php的方法:

1. 使用ThinkPHP的URL重写功能: php \Think\Url::root('/');

2. 修改htaccess配置,添加重写规则: apache RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,L]

3. 修改nginx配置,配置root指向ThinkPHP应用的根目录即可,无需更改其他内容。

tp5去除index.php的方法:1、使用“\think\Url::root('/');”;2、修改htaccess配置,代码如“ RewriteCond %{REQUEST_FILENAME}...”;3、修改nginx配置即可。

阅读全文

本文共计445个文字,预计阅读时间需要2分钟。

如何在不使用index.php的情况下配置ThinkPHP5?

删除tp5的index.php的方法:

1. 使用ThinkPHP的URL重写功能: php \Think\Url::root('/');

2. 修改htaccess配置,添加重写规则: apache RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,L]

3. 修改nginx配置,配置root指向ThinkPHP应用的根目录即可,无需更改其他内容。

tp5去除index.php的方法:1、使用“\think\Url::root('/');”;2、修改htaccess配置,代码如“ RewriteCond %{REQUEST_FILENAME}...”;3、修改nginx配置即可。

阅读全文