【问题标题】:Nginx redirect users from / to index.phpNginx 将用户从 / 重定向到 index.php
【发布时间】:2016-11-15 14:37:19
【问题描述】:

我需要将用户从 root 重写为 index.php,因为现在在谷歌分析中我看到 2 行:

/            .............  112 
/index.php   .............  34

如何将打开 http://example.comhttp://example.com/ 的用户重定向到 http://example.com/index.php ?

【问题讨论】:

标签: nginx


【解决方案1】:

这种方式对我有用:

location = / {
    return 301  /index.php;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-16
    • 1970-01-01
    • 2015-07-05
    • 2015-10-25
    • 1970-01-01
    • 2013-02-07
    • 2013-01-21
    相关资源
    最近更新 更多