{"id":163,"date":"2011-11-25T08:38:06","date_gmt":"2011-11-25T08:38:06","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=163"},"modified":"2011-11-25T08:38:06","modified_gmt":"2011-11-25T08:38:06","slug":"moving-wordpress-blog-from-a-subdomain-to-a-subfolder","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/moving-wordpress-blog-from-a-subdomain-to-a-subfolder\/","title":{"rendered":"Moving WordPress blog from a subdomain to a subfolder"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"25\" data-permalink=\"https:\/\/pixert.com\/blog\/how-to-upgrade-wordpress\/wordpresslogo\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" data-orig-size=\"498,113\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"WordPress &#8211; the logo\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=300%2C68&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" class=\"aligncenter size-medium wp-image-25\" title=\"WordPress - the logo\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=300%2C68\" alt=\"\" width=\"300\" height=\"68\" srcset=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?resize=300%2C68&amp;ssl=1 300w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?w=498&amp;ssl=1 498w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I had this blog and this main site on same domain, pixert.com a year ago. I got high traffic to same domain.<\/p>\n<p>I separated the blog from main site after serious problems occurred. I made pixert.com\/blog for blog and pixert.com for main site<br \/>\nThat&#8217;s a mistake I should \u00a0not done.<\/p>\n<p>Most startups have their blog on a separate sub domain like pixert.com\/blog or blog.[your_domain].com<br \/>\nThe thought of we could optimize it for SEO through the sub domain was wrong.<br \/>\nThe traffic to the blog and the site lower than it was on same domain, pixert.com.<\/p>\n<p>I decided to merge pixert.com\/blog to pixert.com, I&#8217;m moving the blog to pixert.com\/blog or [your_domain].com\/blog .<br \/>\nIt&#8217;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<\/p>\n<p>1. Disable a Caching plugin installed on the site<br \/>\nDelete the cache and disable that plugin<\/p>\n<p>2. Change WordPress address (URL) and\u00a0Site address (URL)<br \/>\nI change\u00a0\u00a0WordPress address (URL) and\u00a0Site 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 -&gt;General)<\/p>\n<p>3. Update Permalink structure.<br \/>\nDon&#8217;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<\/p>\n<p>3. Change Sub Domain root in cPanel<br \/>\nI 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.<br \/>\nI 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.<\/p>\n<p>4. Redirect old URLs to the new URL via .htaccess<br \/>\nCreate new .htaccess on new Sub Ddomain root, add the following<\/p>\n<pre class=\"brush: bash; title: Code Block; notranslate\" title=\"Code Block\">\r\n&lt;pre&gt;Options +FollowSymlinks\r\nRewriteEngine on\r\nrewritecond %{http_host} ^blog.your_domain.com &#x5B;nc]\r\nrewriterule ^(.*)$ http:\/\/www.your_domain.com\/blog\/$1 &#x5B;r=301,nc]&lt;\/pre&gt;\r\n<\/pre>\n<p>If someone tries to visit, http:\/\/pixert.com\/blog\/web-page-compression-enable-gzip-encoding-and-caching\/, the server will (301) redirect to http:\/\/pixert.com\/blog\/web-page-compression-enable-gzip-encoding-and-caching\/<\/p>\n<p>5. Remove the old blog subdomain from Google Webmaster Tools<br \/>\n6. Submit all sitemaps from new URL through [your_domain].com account to Google using Google Webmaster Tools.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s a mistake I should \u00a0not done. Most startups have their blog [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13,5],"tags":[15,49,6,7,44],"class_list":["post-163","post","type-post","status-publish","format-standard","hentry","category-cpanel","category-wordpress","tag-cpanel-2","tag-htaccess","tag-wordpress-2","tag-wp","tag-wp-admin"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-2D","jetpack-related-posts":[{"id":254,"url":"https:\/\/pixert.com\/blog\/redirect-old-domain-to-new-domain\/","url_meta":{"origin":163,"position":0},"title":"Redirect Old Domain to New Domain","author":"Pixel Insert \/ Pixert","date":"July 14, 2012","format":false,"excerpt":"How to redirect old domain to new domain through .htaccess? You should add this code in .htaccess file Method no 1 [text] Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http:\/\/www.newdomain.com\/$1 [R=301,L] [\/text] Method no 2 [text] Redirect 301 \/ http:\/\/www.newdomain.com\/ [\/text]","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":111,"url":"https:\/\/pixert.com\/blog\/how-to-disable-directory-browsing\/","url_meta":{"origin":163,"position":1},"title":"How to disable directory browsing?","author":"Pixel Insert \/ Pixert","date":"June 3, 2011","format":false,"excerpt":"One of the must do on setting a secure Apache webserver is to disable directory browsing. This could prevent the server from showing a listing of the existing files if there's no index in one folder. Disable directory browsing via .htaccess Add in the .htaccess file the following [bash] Options\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/feather-small.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":86,"url":"https:\/\/pixert.com\/blog\/protect-htaccess-file\/","url_meta":{"origin":163,"position":2},"title":"Protect .htaccess file","author":"Pixel Insert \/ Pixert","date":"April 5, 2011","format":false,"excerpt":"When avisitor tries to obtain access to .htaccess file, server automatically generates a 403 forbidden error. However, we can apply an extra layer of security to .htaccess Add the following [text] # Protect the htaccess file <Files .htaccess> Order Allow,Deny Deny from all <\/Files> [\/text] Note: htaccess file permissions is\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock-150x150.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":34,"url":"https:\/\/pixert.com\/blog\/how-tp-transfer-cpanel-accounts-from-one-server-to-another-cpanel-server\/","url_meta":{"origin":163,"position":3},"title":"How to transfer cPanel accounts from one server to another cPanel server","author":"Pixel Insert \/ Pixert","date":"March 8, 2011","format":false,"excerpt":"The server we are transferring the accounts from : OLD SERVER The server to are transferring the accounts to : NEW SERVER PROCESS ON NEW SERVER 1. Log into WHM. If your server is a new server, create a main account. The main account is also your new server's\u00a0 name\u2026","rel":"","context":"In &quot;cPanel&quot;","block_context":{"text":"cPanel","link":"https:\/\/pixert.com\/blog\/category\/cpanel\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/cpanel-logo.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":117,"url":"https:\/\/pixert.com\/blog\/hide-the-apache-web-server-version-number\/","url_meta":{"origin":163,"position":4},"title":"Hide the Apache Web Server Version number","author":"Pixel Insert \/ Pixert","date":"June 6, 2011","format":false,"excerpt":"There are two config directives that controls Apache version. The\u00a0ServerSignature directive adds a line containing the Apache HTTP Server server version and the ServerName to any server-generated documents, such as error messages sent back to clients. The\u00a0ServerTokens directive controls whether Server response header field which is sent back to clients\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/feather-small.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":98,"url":"https:\/\/pixert.com\/blog\/wordpress-which-privileges-are-needed-by-mysql-database-user\/","url_meta":{"origin":163,"position":5},"title":"WordPress: Which privileges are needed by MySQL Database User","author":"Pixel Insert \/ Pixert","date":"May 2, 2011","format":false,"excerpt":"The famous 5 minutes installation for WordPress state that: Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it Most installation instruction for WordPress on the web state that you can GRANT ALL PRIVILEGES to that\u2026","rel":"","context":"In &quot;cPanel&quot;","block_context":{"text":"cPanel","link":"https:\/\/pixert.com\/blog\/category\/cpanel\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/05\/mysqlwp.jpg?fit=523%2C368&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/comments?post=163"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/163\/revisions"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}