• We recently built a replacement site using WordPress and we’ve switched over to that.

    Originally we built it under a subdomain wp.example.com

    Moving to live, we changed the root domain to look at the wp installation so you can access it through “example.com” now but also still “wp.example.com”. In WP itself, the Site URL is “example.com” and the WordPress URL is still “wp.example.com”.

    This is all well and good, but naturally we’re getting some CORS errors for certain resources because the policy isn’t set.

    We can do the CORS policy but I wanted to know what the dangers were, if any, of simply changing the WordPress URL so they both match. As I said, the root domain is directed to the WordPress install so you can get to all the files there.

    Ultimately I’d then want to permanently redirect any wp.example.com requests to example.com

    We’re relatively new to WordPress itself so I wanted to ask what risks there might be.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you have shell access, you can use WP-CLI search and replace function to search and replace strings in the WordPress database. For example: wp search-replace olddomain newdomain you can use --dry-run to test it.

    Please refer to https://developer.ww.wp.xz.cn/cli/commands/search-replace/ for more information about it.

    Thread Starter Chris

    (@kwltadmin)

    Thanks.
    Would doing this replace function cover the WordPress URL in the config as well or would that be a separate item?
    That parameter is in the db I think?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Question on changing URLs’ is closed to new replies.