Topics

On this page

Last updated on Jul 23, 2021

Moving WordPress from Subdomain To Root Domain

If you have a blog at http://blog.example.com/ and you want to move it to WordPress at – http://example.com/

You can put following htaccess rewrite rules on blog.example.com

RewriteEngine On
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

If you want blog homepage to redirect to – http://example.com/blog/ (you will need this if http://example.com/ has a static-homepage) then you can try following:

RewriteEngine On
RewriteRule ^/?$    http://example.com/blog/    [R=301,L]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

For other way round, refer to moving a WordPress blog from subdirectory to subdomain.