Archivi Tag: wordpress


Recently I moved this site to BlueHost.com because it is one of the approved WordPress provider and there are many hosting plans for all pockets, and Ive subscribed the basic one (http://www.bluehost.com/shared) 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 lolloland.com) and, if you want to install WordPress under the root of you domain (in my case https://www.lolloland.com) 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:

/public_html/
             domain1/
                     www/
             domain2/
                     www/
                     www2/
             domain3/
                     www/

First problem for my compulsive order is that BlueHost.com doesn’t permit to move the WP files under a subdirectory without change the URL of you site (example: https://www.lolloland.com/domain1/www). 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: http://codex.wordpress.org/Moving_WordPress ; 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 BlueHost.com following these instructions HERE (WP was instaled under main domain, https://www.lolloland.com, 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} ^lolloland.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.lolloland.com$ 
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 BlueHost.com 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! 😉

 Links

 

 

Cari fedelissimi lettori (numero 2 al massimo) data la disfatta di spaces.live.com che e’ stato trasformato in una succursale di WordPress, a pagamento per altro, ho deciso di installare WordPress direttamente sul mio server, almeno tutti i servizi sono gratis.

Il blog subirà parecchie rivisitazioni prima di arrivare alla sua veste definitiva. Portate pazienza…

Saluti, L.

Powered by WordPress &Web Design Company - Modified by Lorenz