admin管理员组

文章数量:1326515

We are planning to migrate one of our sites since it has been hacked and recovered. We want it to migrate to a new domain (account but same hosting). Now my problem is the site we want to migrate to a new domain is already on https and the new domain is still http since it's newly bought.

When I try to connect my database to the new domain do I need to set the home and site url to https://newdomain in the wp_options in my database to match the old domain? or just http://?

I'm afraid that it may cause an error and im new to wordpress development that is why im anxious. I would appreciate if u can help me out.

We are planning to migrate one of our sites since it has been hacked and recovered. We want it to migrate to a new domain (account but same hosting). Now my problem is the site we want to migrate to a new domain is already on https and the new domain is still http since it's newly bought.

When I try to connect my database to the new domain do I need to set the home and site url to https://newdomain in the wp_options in my database to match the old domain? or just http://?

I'm afraid that it may cause an error and im new to wordpress development that is why im anxious. I would appreciate if u can help me out.

Share Improve this question edited Aug 10, 2020 at 14:56 Tom J Nowell 61k7 gold badges79 silver badges148 bronze badges asked Aug 10, 2020 at 14:16 rusalrusal 1 2
  • You should get HTTPS/TLS/SSL enabled on the new domain. Not because WP demands it, but because it's the responsible thing to do, and to go back to https would be insecure, and reduce your performance and SEO. Nothing good comes of going https -> http – Tom J Nowell Commented Aug 10, 2020 at 14:50
  • Hi! Yeah that's what I was initially planning but halted the process since I'm a bit confused. I used really simple ssl plugin to force my old site from http to https and was thinking to do the same for the new domain. But since the backup of my site that I am planning to migrate to the new domain contains the same plugin and has 301 redirect enabled. Iwas thinking if it will just override the plugin that makes the new domain https. Im sorry for the naive questions, thank u so much. – rusal Commented Aug 11, 2020 at 0:59
Add a comment  | 

1 Answer 1

Reset to default 0

The values in wp_options should match exactly the URL you want to use to access the site.

Without any specific configuration to do it, Wordpress doesn't care if it's https or http as long as the settings match how you access the site.

So you should change it to http until you get your SSL on your new site, and then change all the settings to https once https is working on your new site.

EDIT:

As per @TomJNowell's comment, this is not a great situation to be in because Wordpress may still have URL's that contain the 'old' https value fixed in post content, so these will not work until you get your https working.

You can change those back to http if you want. How to do this is documented many places online, for example there are some sensible instructions here, but it does seem much easier just to get https working rather than do all that work twice.

本文标签: sslWebsite Migration (with https) to a new domain(http)