Host the wp-admin on another domain?

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.

Read More

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?

Related posts

Leave a Reply

3 comments

  1. 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.

  2. What I would do (I was actually doing that many times) is:

    • Change the domain name for the existing WP installation using, for example, this tool. Then, everything on your old site will get the “admin.example” links.
    • Change the URLs back when retrieve DB records to use on the new site. When I was doing that, I never accessed the “admin” DB directly. Instead, I had a script that was taking only the tables and records I needed and copied from “admin” to “www” servers.