BlueHost WordPress mod_rewrite configuration

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 http://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: http://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, http://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

 

Il Paradiso è dove:
- i poliziotti sono Inglesi
- gli chef sono Italiani
- i meccanici sono Tedeschi
- gli amanti sono Francesi
- tutto e’ organizzato dagli Svizzeri

L’Inferno è dove:
- i poliziotti sono Tedeschi
- gli chef sono Inglesi
- i meccanici sono Francesi
- gli amanti sono Svizzeri
- e tutto e’ organizzato dagli Italiani

Amara terra mia (1971?)
Domenico Modugno
YouTubehttp://www.youtube.com/watch?v=e9EdbVdz6gk (cantata da Massimo Ranieri)

Sole alla valle,
sole alla collina.
Per le campagne
non c’è più nessuno.

Addio, addio amore,
io vado via.
Amara terra mia,
amara e bella.

Cieli infiniti
e volti come pietra.
Mani incallite
ormai senza speranza.

Addio, addio amore,
io vado via.
Amara terra mia,
amara e bella.

Tra gli uliveti
è nata già la luna.
Un bimbo piange,
allatta un seno magro.

Addio, addio amore,
io vado via.
Amara terra mia,
amara e bella!

Addio, addio amore,
io vado via.
Amara terra mia,
amara e bella!

 

Gimme the prize (1986)
Queen

 

‘..garage and water from the sprinklers
It also left a man’s decapitated body lying on the floor next to his own severed head, a head which at this time has no name’

‘I know his name’

Here I am I’m the master of your destiny
I am the one the only one I am the god of kingdom come
Gimme the prize just gimme the prize
Give me your kings let me squeeze then in my hands
Your puny princes
Your so called leaders of your land
I’ll eat them whole before I’m done
The battle’s fought and the game is won
I am the one the only one
I am the god of kingdom come
Gimme the prize just gimme the prize

‘Now you die’

‘I have something to say,it’s better to burn out than to fade
away…
There can be only one’

Move over I said move over
Hey hey hey clear the way
There’s no escape from my authority – Didn’t I tell you
I am the one the only one I am the god of kingdom come
Gimme the prize just gimme the prize
I am the one the only one
I am the god of kingdom come
Gimme the prize

There can be only one.

 

NOTE:

Il Piccolo Principe

In quel momento apparve la volpe.
“Buon giorno”, disse la volpe.
“Buon giorno”, rispose gentilmente il piccolo principe, voltandosi: ma non vide nessuno.
“Sono qui”, disse la voce, “sotto al melo…”
“Chi sei?” domando’ il piccolo principe, “sei molto carino…”
“Sono una volpe”, disse la volpe.
“Vieni a giocare con me”, le propose il piccolo principe, sono cosi’ triste…”
“Non posso giocare con te”, disse la volpe, “non sono addomestica“.
“Ah! scusa”, fece il piccolo principe.
Ma dopo un momento di riflessione soggiunse:
Che cosa vuol dire ?
“Non sei di queste parti, tu”, disse la volpe, “che cosa cerchi?”
“Cerco gli uomini”, disse il piccolo principe.
“Che cosa vuol dire ?”
“Gli uomini” disse la volpe, “hanno dei fucili e cacciano. E’ molto noioso! Allevano anche delle galline. E’ il loro solo interesse. Tu cerchi delle galline?”
“No”, disse il piccolo principe. “Cerco degli amici. Che cosa vuol dire “?”
E’ una cosa da molto dimenticata. Vuol dire …
Creare dei legami?

Continue reading “Il Piccolo Principe e la Volpe” »

Powered by WordPress &Web Design Company - Modified by Lorenz