WordPress ignores new site URL and home page when hosted on another domain
P粉269530053
P粉269530053 2024-01-16 16:57:37
0
1
450

I have the following setup for my client:

Wordpress is hosted at siteground.com with externalhost.com/blog => A valid Wordpress installation.

AWS application "myapp.com" managed by Amplify, rewriting /blog should point to externalhost.com/blog, but user myapp.com/blog is shown.

Then I switched siteurl and home in the wp-config.php file:

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

It almost works, but there are some cases where it doesn't work. What I've noticed so far: Pagination within the page section holds the link to the next page externalhost.com/blog. The menu section link redirects to the externalhost.com/blog section.

It feels like not all links are changing everywhere in WordPress, especially in pagination, and I can't find a solution. Maybe someone out there is experiencing the same behavior or thoughts that I can change?

P粉269530053
P粉269530053

reply all(1)
P粉186897465

When switching website URLs or moving the site to new hosting etc. I find that I need to do a search and replace in the database, this can be done using the following plugin: https://wordpress.org/plugins /better-search-replace/ Search the old url externalhost.com and replace it with the new url myapp.com This should solve your problem, the plugin usually allows you to Conduct a test run before making changes.

Another way to do migration is to use a plugin, for example: https://wordpress.org/plugins/all-in-one-wp-migration/

After you are finished using the plugins, you should be able to remove them from the project

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template