WordPress subfolder installation
From Wiki @ Karl Jones dot com
Revision as of 15:23, 28 August 2016 by Karl Jones (Talk | contribs)
This article discusses the installation of WordPress in a subfolder.
WordPress in a subfolder
It is common to install WordPress is a subfolder of a web server (rather than directly in the root of the server).
You then create a document in the web server root named index.php, which serves as the home page. It contains PHP code to display the WordPress content.
This example assumes that the WordPress subfolder is named wp.
Benefit
Installing WordPress in a subfolder is useful if you wish to install other web applications on the website.
By installing each web application in its own subfolder, you minimize the chance of conflict between applications.
Making home page display contents of subfolder
In the root folder of your website, create a document named index.php, and enter this PHP code:
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );