• I have a WP installation that needs moving to a new site URL.

    Usually, I do this with wp-cli (for both option “site” and “home”). In the past I’ve changed it in the database too.

    This time, however, when I do this, the “https://” part of the URL is missing. The site loads, but all links on the page go to a raw path and therefore 404.

    Does anyone know what might be causing this? I’ve tried the operation using a vanilla fresh download of WP and it works OK so I assume it’s some setting in the site that’s doing it.

    BTW when I add this to wp-config.php the same problem occurs:

    update_option(‘siteurl’,’https://example.com’);
    update_option(‘home’,’https://example.com’);

    • This topic was modified 5 years, 6 months ago by gilgongo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • In wp-config that should be

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

    Instead of update option… I think the spacing is important, too.

    Thread Starter gilgongo

    (@gilgongo)

    Thanks, but I’m afraid that doesn’t work either. The site name IS being changed, but when the site loads, the links to any posts lack the initial “https://” part.

    I note that links to CSS files and other things are OK though (or else the site wouldn’t load properly).

    I suspect some issue with the post URL generation in some way – but what?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Siteurl change strips “https://” prefix?’ is closed to new replies.