SiteCozy

  • My account

How to move a multisite wordpress install from subfolder to subdomain

2018-08-12

Create the subdomain in the DNS records

Please read all the actions before starting.

DNS records

In the hosting administration, you should add an A record to map the new subdomain to the IP address of your web server. For example: uk.yourdomain.com a 192.168.1.1. It is automatically done in Cpanel, Plesk or Directadmin when you create a subdomain. So, you don’t need to do it if you use Cpanel, Plesk or Directadmin.

Map the subdomain to the multisite install folder

Your subdomain should point to the folder where the WordPress multisite is installed. For example, if you use Cpanel, go to “subdomain”, add your subdomain and choose the folder of your WordPress multisite folder that already exists. This job will also create a DNS record automatically.

Change the .htaccess file to the following

 
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

Change the wp-config:

define(‘WP_DEBUG’, false);
define(‘MULTISITE’, true);
define(‘SUBDOMAIN_INSTALL’, true);
define(‘DOMAIN_CURRENT_SITE’, ‘yourdomain.com’);
define(‘PATH_CURRENT_SITE’, ‘/’);
define(‘SITE_ID_CURRENT_SITE’, 1);
define(‘BLOG_ID_CURRENT_SITE’, 1);

Change the name of the domain in wp

In WordPress, login into your network site. Go to “sites” and change the urls of your websites from the subfolders “yourdomain.com/subfolder/” to your subdomain “subfolder.yourdomain.com”

Change the links on your webpages

Use a search and replace plugin to change the URL links on your web pages from yourdomain.tld/yoursubfolder/example to subfolder.yourdomain.tld/example

You can do it using a plugin that will search and replace the strings in bold above in the table wp_posts which contains your wordpress pages and posts.

Related Posts:

  • Create a subdomain in Cpanel - tutorial & explanation
  • Switch your multisite wordpress install. from subfolder to subdomain - Tutorial -
  • How to install an additional domain in Cpanel?
Download our Broken link checker freeware here Buy a license key for the Sitecozy broken link checker

Customer Login

Lost password?

Categories

  • Webmaster advice
  • SEO advice
  • Web hosting
  • SiteCozy link checker KB
  • WordPress theme & plugin reviews
  • All articles
Disclosure: We are a professional review site that receives compensation from the companies whose products we review. We test each product thoroughly and give high marks to only the very best. We are independently owned and the opinions expressed here are our own.

Copyright Sitecozy 2018