为什么我的页面重定向到我的 wordpress 博客中的 localhost?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9764722/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:53:46  来源:igfitidea点击:

Why does my page redirect to localhost in my wordpress blog?

wordpressredirectlocalhostwordpress-theming

提问by Symfony

This is my site URL http://www.weblogicsol.com/, Here I installed a wordpress themehaving URL http://www.weblogicsol.com/blog, the problem is this when I want to open the wp-admin(means when I write http://www.weblogicsol.com/blog/wp-admin) it redirectto localhost. Please help me to solve this problem, I am in trouble.

这是我的站点 URL http://www.weblogicsol.com/,这里我安装了一个具有 URL http://www.weblogicsol.com/blogwordpress 主题,问题是当我想打开wp-admin(意味着当我写http://www.weblogicsol.com/blog/wp-admin) 它重定向localhost。请帮我解决这个问题,我有麻烦了。

And if I write this code in wp-config file

如果我在 wp-config 文件中编写此代码

define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');

定义('WP_HOME','http://example.com'); 定义('WP_SITEURL','http://example.com');

then this URL appears with an error message.

然后此 URL 出现并带有错误消息。

http://weblogicsol.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fwww.weblogicsol.com%2Fblog%2F%2Fwp-admin%2F&reauth=1

http://weblogicsol.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fwww.weblogicsol.com%2Fblog%2F%2Fwp-admin%2F&reauth=1

回答by Andreas Wong

Check your wp-options table and find all occurrence of 'localhost' in option_value field

检查您的 wp-options 表并在 option_value 字段中找到所有出现的 'localhost'

http://codex.wordpress.org/Database_Description#Table:_wp_options

http://codex.wordpress.org/Database_Description#Table:_wp_options

SELECT * from wp_options where option_value like '%localhost%';

and change those to your live URL and you should be set

并将它们更改为您的实时 URL,您应该设置

Here's a very extensive documentation on migrating wordpress http://codex.wordpress.org/Moving_WordPress

这是关于迁移 wordpress http://codex.wordpress.org/Moving_WordPress的非常广泛的文档

回答by Alexey Tsinya

Check the Dashboard -> Settings -> WordPress Address (URL), Site Address (URL)There should NOT be 'localhost'

检查仪表板 -> 设置 -> WordPress 地址 (URL)、站点地址 (URL)不应有“本地主机

回答by Dedy Syaputra

you should check wp_options on your database , modify site url dan home as your web domain

您应该检查数据库上的 wp_options ,将站点 url dan home 修改为您的网络域

回答by jain raj

Here is the way. 1. Login to Phpmyadmin 2. select Db 3. goto table "wp_options" 4. change url in siteurl & home.

这是方法。1. 登录 Phpmyadmin 2. 选择 Db 3. 转到表“wp_options” 4. 更改 siteurl 和 home 中的 url。

its works 100%

它的作品 100%

回答by jain raj

There are two areas in the WP_OPTIONS that you need to change. One is one the fisrt page and the other one is on the 2nd page.

WP_OPTIONS 中有两个区域需要更改。一个是第一页,另一个在第二页。

This video will definitely help if you have access to phpMyAdmin

如果您可以访问 phpMyAdmin,此视频肯定会有所帮助

http://educhalk.org/blog/?p=21

http://educhalk.org/blog/?p=21