Index in root, wordpress in subdirectory

WordPress core in a subdirectory, but accessed via the root folder

If you’re trying to move WP to a subdirectory, but access it from the root, use the following approach.

Keep your index file in the root, but point it to the proper path: ./SUBDIRECTORY/wp-blog-header.php instead of ./wp-blog-header.php

Make sure you change you change the home and siteurl settings to match your directory structure either in Settings->General or by adding the following to your wp-config.php file:

define('WP_HOME','http://yourdomain.com');
define('WP_SITEURL','http://yourdomain.com/SUBDIRECTORY');

WordPress completely isolated to a subdirectory

If you would like to keep WP completely in the subdirectory, just move your .htaccess index.php files to the sub instead of the root. As long as it doesn’t conflict with the root .htaccess, it should work just fine. You can have nested .htaccess files within subdirectories and permalinks should work just fine.

Leave a Comment