admin管理员组文章数量:1317906
I have moved one of my website to a new domain, below is what i did.
- Backed up database
- Uploaded all the files to the new server.
- Imported sql into new server via
phpmyadmin
- Now i have used this script to change URL in database.
Now, problems i am facing are:
- All the links are going to old domain.
- All the images are linked to old domain.
wp-admin
is also redirected to old domain when i try to runmydomain/wp-admin
Please help if you have any ideas about this, any help would be greatly appreciated.
I have moved one of my website to a new domain, below is what i did.
- Backed up database
- Uploaded all the files to the new server.
- Imported sql into new server via
phpmyadmin
- Now i have used this script to change URL in database.
Now, problems i am facing are:
- All the links are going to old domain.
- All the images are linked to old domain.
wp-admin
is also redirected to old domain when i try to runmydomain/wp-admin
Please help if you have any ideas about this, any help would be greatly appreciated.
Share Improve this question asked May 7, 2015 at 10:15 Soeb SafiSoeb Safi 4933 gold badges6 silver badges16 bronze badges 2 |6 Answers
Reset to default 14My issue is resolved, I am posting this as an answer so that someone else can benefit out of it.
My issue was, siteurl
and homeurl
were not updated, so I have placed define('RELOCATE',true);
in my wp-config.php
file. And again tried to access the website , it gone to the correct URL but all the CSS was gone.
Then I headed over to wp-admin
and it also came with no CSS but still I tried to login but this time it has taken me to the correct URL and with CSS login page but didn't log in. Then again I attempted to login and this time I was successful.
Then I changed both the URLs from settings in the admin panel.
After this you must to delete all your browser cache files to delete any kind of persistent redirection.
Hope this helps someone else dealing with the same problem.
I had the same problem (works fine now), here is what i done
instead of try to access to the admin panel whit yoursite/wp-admin i tried with yoursite/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.
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';
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 with newdomain)
- Save the updated SQL and import it back into phpMyAdmin.
Voila!
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.
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/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).
本文标签: urlsRedirecting to old domain after migration
版权声明:本文标题:urls - Redirecting to old domain after migration 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742030737a2416393.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
define('WP_SITEURL', 'https://domain'); define('WP_HOME', 'https://domain');
– Vignesh Chinnaiyan Commented Jun 12, 2018 at 23:48