Moving WordPress blog from a subdomain to a subfolder

I had this blog and this main site on same domain, pixert.com a year ago. I got high traffic to same domain.

I separated the blog from main site after serious problems occurred. I made pixert.com/blog for blog and pixert.com for main site
That’s a mistake I should  not done.

Most startups have their blog on a separate sub domain like pixert.com/blog or blog.[your_domain].com
The thought of we could optimize it for SEO through the sub domain was wrong.
The traffic to the blog and the site lower than it was on same domain, pixert.com.

I decided to merge pixert.com/blog to pixert.com, I’m moving the blog to pixert.com/blog or [your_domain].com/blog .
It’s a delicate process to move pixert.com/blog to pixert.com. My concern in traffic from Google, the old URLs redirect to the new site

1. Disable a Caching plugin installed on the site
Delete the cache and disable that plugin

2. Change WordPress address (URL) and Site address (URL)
I change  WordPress address (URL) and Site address (URL) from pixert.com/blog to pixert.com/blog. This is a simply a matter of updating WordPress address and Blog address options from within the WordPress administration panel (Settings ->General)

3. Update Permalink structure.
Don’t forget to save Permalinks once more to make sure your WordPress site run smoothly. No need to change settings if you want to keep up same settings

3. Change Sub Domain root in cPanel
I created the blog subfolder in cPanel. The blog sub domain maps to a directory in the webroot called /blog/, however this directory been used by the new URL, pixert.com/blog.
I change the document root so I can apply redirection. If someone visits a link to a page that includes the sub domain, the web server will tell the browser that new site.

4. Redirect old URLs to the new URL via .htaccess
Create new .htaccess on new Sub Ddomain root, add the following

<pre>Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^blog.your_domain.com [nc]
rewriterule ^(.*)$ http://www.your_domain.com/blog/$1 [r=301,nc]</pre>

If someone tries to visit, https://pixert.com/blog/web-page-compression-enable-gzip-encoding-and-caching/, the server will (301) redirect to https://pixert.com/blog/web-page-compression-enable-gzip-encoding-and-caching/

5. Remove the old blog subdomain from Google Webmaster Tools
6. Submit all sitemaps from new URL through [your_domain].com account to Google using Google Webmaster Tools.

%d bloggers like this: