Making the Blog Appear in a Non-Root Folder

This site will be customized as bellow:

  • WordPress start at the site's root, https://www.ivanteoh.com/.
  • The blog will be located at https://www.ivanteoh.com/posts/.
  • The other pages, such as "about" page will be located at https://www.ivanteoh.com/about/.

To achieve the goals above, follow the steps as below:

  1. Create two more pages, "Home" and "Blog" beside "About" page in Manage > Pages > Manage Pages section.
  2. Write something on "Home" page. That will be my front page.
  3. Leave "Blog" page blank as it will be my posts page.
  4. Change the address to the site root directory's URL, https://www.ivanteoh.com/ in the box for Blog address (URL) of Settings > General > General Settings section.
  5. Update permalinks structure to begin with "/blog/" in Settings > Permalinks > Customize Permalink Structure > Common settings section. In my case, it would be "/blog/%year%/%monthnum%/%postname%/".
  6. Set "Home" as Front page and "Blog" as Posts page in Front page displays of Settings > Reading > Reading Settings section.
  7. Move the WordPress core files to the new folder. In my case, "blog" folder. I did this step in the beginnings of creating WordPress blog platform in my web hosting.
  8. Copy the index.php and .htaccess files from the WordPress directory ("blog" folder) into root directory of the site.
  9. Edit index.php in root directory with text editor.
  10. Change the line that says: require('./wp-blog-header.php'); to the following, using directory name for the WordPress core files: require('./blog/wp-blog-header.php');
  11. Save the file.

Gallery

References

Comments

Comments powered by Disqus