Move WordPress to new Domain

I gave up my old web hotel (one.com) and moved to a new one (inleed.se) (read more about why here). As a wordpress blog owner, not being very familiar with MariaDB, Apache and PHP this can seem a bit scary.

However, it was quite fine. With a new web hotel and a database ready, this was basically the tools/steps required.

  1. Use WordPress Plugin Duplicator to produce a complete backup (a downloadable zip file) and a downloadable installer (installer.php)
  2. Configure .htaccess on new server to forward requests to a wordpress folder
  3. Upload backup-zip-file and installer.php to wordpress folder on new server
  4. Run installer (go to http://newsite/installer.php), follow instructions
  5. Use WordPress Plugin Velvet Blues Update Urls to make sure all my links point to newsite rather than oldsite.
  6. Create a .htaccess on old server to permanently forward traffic to new domain

I ended up doing this thing twice, learning the first time and perfecting it the second time.

.htaccess on new server

The purpose of this is to place wordpress in its own directory, while still not needing to expose that directory in the URLs.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?techfindings.net$ 
RewriteCond %{REQUEST_URI} !^/techfindings/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /techfindings/$1
RewriteCond %{HTTP_HOST} ^(www.)?techfindings.net$ 
RewriteRule ^(/)?$ techfindings/index.php [L]
</IfModule>

So, wordpress is entirely installed in a directory named techfindings, but behaving like it was in my root. Any other page is served normally.

.htaccess on old server

I don’t want people to access the old site when the new site is up. This was a pretty simple and effective .htaccess file:

RedirectPermanent / https://techfindings.net/

This will be in place as long as my old domain is valid and hosted on the old web hotel.

Conclusion

Moving wordpress from one domain and server to another domain and server is perfectly possible with a good result.

  1. Goodbye One.com – Hi Inleed.se | TechFindings - pingback on 2020/08/11 at 16:20

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trackbacks and Pingbacks: