迁移后重定向到旧域
-
-
我在wp-config.php中添加了这些行,并且它起作用了. `define('WP_SITEURL','https://domain.com'); define('WP_HOME','https://domain.com');`I have added these lines in wp-config.php and it worked. `define('WP_SITEURL', 'https://domain.com'); define('WP_HOME', 'https://domain.com');`
- 2
- 2018-06-12
- Vignesh Chinnaiyan
-
检查此链接可能对您有帮助.https://www.phparticles.com/wordpress/replace-old-to-new-url-in-the-wordpress-database/Check this link which might be helpful to you. https://www.phparticles.com/wordpress/replace-old-to-new-url-in-the-wordpress-database/
- 0
- 2020-07-20
- Mr.Happy
-
6 个回答
- 投票数
-
- 2015-05-07
我的问题已解决,我将其发布为答案,以便其他人可以从中受益.
我的问题是,
siteurl
和homeurl
未更新,所以我将define('RELOCATE',true);
放在了我的wp-config.php
文件.然后再次尝试访问该网站,它转到了正确的URL,但所有css
都消失了. 然后我转到wp-admin
,它也没有提供css
,但是我仍然尝试登录,但这一次它把我带到了正确的url和with css
登录页面,但没有登录.然后再次尝试登录,这次我成功登录了. 然后,在管理面板的urls
中更改了两个settings
.此后,您必须删除所有浏览器缓存文件,以删除所有类型的持久性重定向.
希望这可以帮助其他人处理相同的问题.
My issue is resolved, I am posting this as an answer so that someone else can benefit out of it.
My issue was,
siteurl
andhomeurl
were not updated, so I have placeddefine('RELOCATE',true);
in mywp-config.php
file. And again tried to access the website , it gone to the correct url but all thecss
was gone. Then I headed over towp-admin
and it also came with nocss
but still I tried to login but this time it has taken me to the correct url andwith css
login page but didn't logged in. Then Again I have attempted to login and this time I have logged in successfully. Then I have changed both theurls
fromsettings
in the admin panel.After this you must to delete all your browser cache files to delete anny kind of persistant redirection.
Hope this helps someone else dealing with the same problem.
-
那帮了我大忙!That did the trick for me!
- 0
- 2018-11-29
- Avishai
-
嗨!我想知道在您的配置文件中添加的行踪,因为我在几个地方尝试都没有成功.Hi! I'm wondering whereabouts in your config file you added this, because I'm trying at several places with little success.
- 0
- 2018-12-10
- QuestionerNo27
-
- 2015-08-29
我遇到了同样的问题(现在可以正常工作),这是我所做的
我尝试使用yoursite.com/wp-login.php而不是尝试访问yoursite.com/wp-admin的管理面板,这使我进入了新站点的管理面板.然后,我在常规设置中更改了站点域,现在可以正常使用了.
I had the same problem (works fine now), here is what i done
instead of try to access to the admin panel whit yoursite.com/wp-admin i tried with yoursite.com/wp-login.php and it took me to the admin panel of my new site. Then I changed the site domain in general settings and now it works just fine.
-
谢谢,我能够编辑设置,现在内部页面工作正常,但主页不工作.我已经更新了首页网址中的永久链接Thanks, I was able to edit the settings and now the internal pages are working just fine but the home page is not working. I have updated the permalinks n the url for the home page
- 0
- 2019-01-03
- viCky
-
- 2018-04-23
更改域时运行以下命令:
UPDATE wp_options SET option_value = 'https://yournew.domain' WHERE option_name = 'siteurl'; UPDATE wp_options SET option_value = 'https://yournew.domain' WHERE option_name = 'home';
Run the following when you are changing domain:
UPDATE wp_options SET option_value = 'https://yournew.domain' WHERE option_name = 'siteurl'; UPDATE wp_options SET option_value = 'https://yournew.domain' WHERE option_name = 'home';
-
但这显然还不够.旧域仍将存储在帖子,侧边栏,其他选项中,等等.But it's clearly not enough. The old domain will be still stored in posts, sidebars, other options and so on...
- 0
- 2018-05-25
- Krzysiek Dróżdż
-
- 2017-02-26
更改wp_options字段会有所帮助,但有时您的页面,帖子和插件将使用对图像和其他文件的绝对引用.在这种情况下,您将需要更新整个数据库.由于在phpMyAdmin中没有简单的"全部替换"(除非您在SQL中构造了UPDATE语句),所以最好:
- 将整个数据库备份为sql文件.(我将包括DROP TABLE选项)
- 将整个数据库导出为sql(文本)文件,然后在文本编辑器中将其打开.(我使用记事本++ )
- 用新域对旧域的所有实例进行全部替换.(即olddomain.com和newdomain.com)
- 保存更新的SQL,然后将其重新导入phpMyAdmin.
Voila!
Changing wp_options field will help a little, but sometimes your pages, posts and plugins will use absolute references to images and other files. In this case, you'll need to update the entire database. Since there's no easy "replace all" in phpMyAdmin (unless you construct an UPDATE statement in SQL), it's best to:
- Backup your entire database as an sql file. (I would include the DROP TABLE option)
- Export your entire database as a sql (text) file and open it in a text editor. (I use Notepad++)
- Do a Replace All of all instances of your old domain with your new domain. (i.e. olddomain.com with newdomain.com)
- Save the updated SQL and import it back into phpMyAdmin.
Voila!
-
如果这不能完全解决问题,请执行以下操作: 1.在wp-config.php中检查您的旧域的任何引用 2.临时重命名您的.htaccess文件 3.临时移动任何安全性或固定链接重写插件文件夹If this doesn't fully resolve the problem: 1. Check for any references of your old domain in wp-config.php 2. Temporarily rename your .htaccess file 3. Temporarily move any security or permalink rewrite plugin folders
- 0
- 2017-02-26
- Tone Williams
-
我认为这是最全面的解决方案.想知道为什么我是第一个人I think this is the most comprehensive solution. Wonder why I'm the first person upvoting
- 0
- 2018-07-25
- che-azeh
-
这是最好的解决方案……注:如果您使用cloudflare,请在cloudflare控制台中清除缓存!This is the best solution... SIDENOTE: If you use cloudflare, clear your cache in your cloudflare console!
- 0
- 2020-05-18
- Evan Parsons
-
- 2016-09-20
在phpmyadmin中的选项数据库文件中更改URL.表示您的实际网址链接.然后打开wp-admin页面..带有wp-login.php链接..输入身份验证,然后在常规设置中再次更改URL目录并访问网站.
Change the URL in option database file in phpmyadmin. Means your actual URL link. Then open wp-admin page..with wp-login.php link.. Type your authentication then in general setting change the URL directory again and access the website.
-
- 2016-10-03
要扩展Reezppo的答案,
在cPanel中打开PHPMyadmin,然后单击wp_options文件,您将看到一堆可以更改的字段,您将看到旧的url,然后可以将其手动更改为新的url(在两个位置).然后将其保存并返回yoursite.com/wp-login.php,它应该使您无需重定向即可登录.请记住,您将使用旧的Wordpress用户名和密码(来自您移出的原始网站的用户名和密码)登录.
To just expand on Reezppo's answer,
Open PHPMyadmin in your cPanel and then click on the wp_options file and then you will see a bunch of fields that you can change and you will see the old url which you can then change manually to the new url (in two places). Then save it and go back to yoursite.com/wp-login.php and it should let you login without redirecting. Remember you will be logging in with the old Wordpress username and password (the one from the original site that you have moved).
我已将我的网站之一移至新域,这是我的工作.
phpmyadmin
现在,我面临的问题是:
wp-admin
时,mydomain.com/wp-admin
也重定向到旧域如果您对此有任何想法请提供帮助,我们将不胜感激.