Currenly I have a client that has a WordPress running on, let’s say, www.example.com.

I’m working on a new version using another technology/language that will be hosted on another server.. But the administration (WP) and the database will stay on old server.

So basically I will need to point the www.example.com to the new host (no problem here) and create a subdomain like admin.example.com that will point to the old server with the WP installation.

I’m afraid that this will make a mess on the database while storing options and guids for posts and attachments URLs… They will be stored as admin.example.com and not www.example.com, am I right?

How to make the wp-admin run on admin.example.com and store URLs on the database as www.example.com? This would work for the preview links too?

3

Easy solution would be adding this line to your wp-config.php of your admin server code.

define( ‘WP_SITEURL’, ‘http://’ . $_SERVER[‘SERVER_NAME’]);

Then you can access it without modifying the database option.

Leave a Reply

Your email address will not be published. Required fields are marked *