July 29th, 2011
If you want to host WordPress in a subdirectory, but still use it as the site for your main domain, there are 2 simple steps.
Change the url in the WordPress Dashboard
Go to Settings: General. In the field where it asks for your WordPress URL include the full path to the directory in which you installed WordPress. For instance if you install WordPress in a directory called givecamp the URL might be something like: http://www.yoursite.com/givecamp.
In the field for site address put your domain, i.e. http://www.yoursite.com/.
Edit your index.php file
Download index.php from the root directory using your favorite FTP or sFTP program. Note: This is a different index.php file than the one in your theme directory. The file will look something like this:
* 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
/** Loads the WordPress Environment and Template */
Change the line that begins with require to reflect the path to your directory. In our example we would change it from:
Upload the edited file to your root directory.
Categories: WordPress Tips