BlueHost WordPress mod_rewrite configuration

Recently I moved this site to because it is one of the approved WordPress provider and there are many hosting plans for all pockets, and Ive subscribed the basic one ( with unlimited space, domains, websites, mails and more. I want to use this space also for some clients that have little websites so I can share the cost of the hosting.

When you open a BlueHost accont, you need to declare the main domain (in my case il and, if you want to install WordPress under the root of you domain (in my case all WP files are located directly under the /public_html/ directory that is the root of your space. 

I’m a very tidy person 😉 so I want that all domains and all sites are in their own subdirectory and directories must have this structure:


First problem for my compulsive order is that doesn’t permit to move the WP files under a subdirectory without change the URL of you site (example: Of course you can move WP in a subdirectory, but I do not like at all to change standard WP files and links inside posts ( here is what a mean: ; you have to change the file index.php and copy it in the root directory of the server; you have to change permalinks, and so on).
So I decided to work only on the .htaccess file.

I have read tons of pages on “how to move a WordPress site” but I didn’t find anything useful about this case: move a WordPress site from the document root to a subdirectory, without modifying WP original files, without modifying “home” and “site_url“, permalinks or links to media contents (/wp-content/uploads/... )

So this is the procedure I used:

  • I moved my old WP installation to following these instructions HERE (WP was instaled under main domain,, and all files were in the root of server directly under /public_html/ directory);
  • Via FTP I created the correct directory to host WP files (of curse, correct for my compulsive order need 😉 ) : /public_html/lolloland/www
  • I moved all files from /public_html/ to /public_html/lolloland/www EXCEPT the file .htaccess (and php.ini if any);
  • I modified .htaccess file modifying the original configuration of Apache MOD_REWRITE in this way:
# BEGIN WordPress

RewriteEngine On

RewriteCond %{HTTP_HOST} ^$ [NC,OR]
RewriteCond %{HTTP_HOST} ^$ 
RewriteCond %{REQUEST_URI} !lolloland/www/
RewriteRule (.*) /lolloland/www/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [NC,L]

# END WordPress

After that I was able to transfer all other domains on installing them in their own directories (/domain1/www, /domain2/www, …) using, in that case, the standard BlueHost’s WordPress installation procedure.

If you move other domains in your space on BlueHost you MUST NOT REMOVE the two lines of .htaccess file reguarding the directive RewriteCond %{HTTP_HOST} otherwise you’ll receive for these domains a “500 server error” message.

 I hope this post could be useful for everyboby! 😉