如何让ThinkPHP5项目不再显示index.php?

2026-04-02 17:180阅读0评论SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

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

如何让ThinkPHP5项目不再显示index.php?

去除tp5中index.php的方法:

1.使用`\Think\Url::root('/');`

2.修改`.htaccess`配置,代码如`RewriteCond %{REQUEST_FILENAME} ...`

3.修改nginx配置即可。环境:Win10 + PHP 7.1 + Nginx 1.2 + ThinkPHP5 + Dell G3电脑。

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

阅读全文

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

如何让ThinkPHP5项目不再显示index.php?

去除tp5中index.php的方法:

1.使用`\Think\Url::root('/');`

2.修改`.htaccess`配置,代码如`RewriteCond %{REQUEST_FILENAME} ...`

3.修改nginx配置即可。环境:Win10 + PHP 7.1 + Nginx 1.2 + ThinkPHP5 + Dell G3电脑。

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

阅读全文