WordPress | How to make WordPress installed in a sub-folder load as root with out moving files

Search
Contact Info
Level 1, 2 Warner Street, Huntingdale VIC 3166, Australia
1300 552 052
(FAX) 03 9815 6800
Contact Hours 9:00am - 5:30pm
WordPress | How to make WordPress installed in a sub-folder load as root with out moving files

The following procedure will guide you through how to make wordpress load as http://example.com.au while the files are actually located in a sub-folder like /wordpress.

Step 1 - In the root folder / aka httpdocs delete index.htm or index.html if present and create the following files;

.htaccess and populate it with the following;

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

index.php, with this;

<?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__ ) . '/wordpress/wp-blog-header.php' );


Step 2 - in the folder where wordpress is installed, e.g. /wordpress rename index.php to index.ph_ and if found, rename .htaccess to old.htaccess. If you don't do this the site won't load properly!


Step 3 - now we need to configure wordpress, this can be done in one of two ways.

If you have access to the WordPress control panel, login as admin and under settings -> general change;

a) wordpress directory > https://mydomain.com/wordpress (most likely leave as is)

b) site address > https://mydomain.com (remove the /wordpress bit off the end)

If you don't have access to WordPress then you can edit the site database directly in the plesk control panel. Find the database and look for the <dbprefix>_options table, then look for option_id 33 which is labelled as 'home'. Edit the url to how you want it to appear in the browser, in most cases just chop the /wordpress bit off the end and save.

And that should be it.

BACK