Install WordPress into a subdirectory, redirect website traffic to it & hide the subdirectory.

  1. Log into cPanel and install WordPress into a subdirectory on the website.
  2. Go to the General Screen.
    In WordPress address (URL): set the address of your main WordPress core files. Example:
    In Site address (URL): set root directory’s URL. Example:
    Click Save Changes. (Do not worry about the errors that happen now! Continue reading)
  3. Create this .htaccess file and upload it into the site’s root directory.
    # 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]
    # END WordPress
  4. Copy the WordPress index.php file in the subdirectoy into the site’s root directory and then modify this line:
    require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
    to the following, using your directory name for the WordPress core files:
    require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );



Published by

angelo bonavera

Hi I'm a web developer and I run a web hosting company called

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s