【问题标题】:Annoying redirect preventing me using dashboard of WordPress on localhost烦人的重定向阻止我在本地主机上使用 WordPress 仪表板
【发布时间】:2021-12-24 14:28:12
【问题描述】:

由于烦人的重定向,我无法在 locahost 上正确使用 WordPress 仪表板。我已经登录了,但是所有的文件都是从...重定向的。

http://localhost/wp-admin/http://localhost/wp-admin/localhost/wp-admin/

真的很烦。

我尝试了很多解决方案...

  1. 我查看了虚拟主机。没什么用。
  2. 我已经从 live 复制了 .htaccess。然后停放.htaccess。不走运。
  3. 我已经停放了真正简单的 ssl 插件。
  4. 我已禁用 mod-rewrite 并再次启用它。

我不知道这个重定向是从哪里来的。我正在使用远程(实时)数据库,并在 wp-config 中设置了这个...

define('WP_HOME','localhost');
define('WP_SITEURL','localhost');

我也尝试将实时数据库复制到本地。不走运。

【问题讨论】:

  • 您可以尝试禁用所有插件并检查重定向。
  • define('WP_HOME','http://localhost'); define('WP_SITEURL','http://localhost'); 能解决你的问题吗?
  • @AmitVerma 这应该作为答案而不是评论发布。评论是临时的,不能被接受为答案。没有将 cmets 转换为答案的机制,所以我不能为你做。您需要将您的评论复制到答案框中,然后删除您的评论。

标签: php wordpress .htaccess


【解决方案1】:

感谢@AmitVerma。我刚刚编辑了 wp-config.php 并将 'localhost' 替换为 'http://localhost/' 并且它起作用了。

换句话说,我将它添加到 wp-config.php...

define('WP_HOME','http://localhost/'); 
define('WP_SITEURL','http://localhost/');

【讨论】:

    猜你喜欢
    • 2018-06-15
    • 2017-10-04
    • 2012-03-28
    • 2018-09-17
    • 2023-04-06
    • 2018-03-19
    • 2018-12-29
    • 2020-07-24
    • 1970-01-01
    相关资源
    最近更新 更多