How to move your Drupal 7 site to a different folder on your domain...

By tonyhughes Hughes, in , posted: 4-Jan-2013 14:33

So you want to move your Ubuntu 12.04 Drupal 7 installation from to huh?

So much incomplete information out there, and people scratching their heads. This is how its done:

On Debian Wheezy where Drupal was obtained/installed using wget/dpkg:

1. Go to /var/www and rename the Drupal folder:

mv oldfolder newfolder

2. Go to /usr/share/drupal7/.htaccess and set/change the rewritebase rule to:

RewriteBase /newfolder

All done!

On Ubuntu Server 12.04 LTS where Drupal was installed via apt-get:

1. Open /usr/share/drupal7/sites/default/settings.php and set:

$base_url = "";

2. Go to /usr/share/drupal7/.htaccess and set/change the rewritebase rule to:

RewriteBase /newfolder

3. Go to etc/apache2/mods-enabled/drupal.conf and empty it (or just change it with lines from step 4 if thats your preference)

4. Uncomment and add the following lines to /etc/apache2/sites-enabled/000-default

#Alias /newfolder /usr/share/drupal7
#<Directory /usr/share/drupal7/>
# Options +FollowSymLinks
# AllowOverride All
# order allow,deny
# allow from all

5. Restart Apache:
sudo service apache2 restart

All done!

Other related posts:
HOWTO: Install Ubuntu Server 12.04 LTS and get working mailserver
I want broadband, why do I have to wait 3 days to even know if its POSSIBLE?
Lotteries Commission using open source software

Author's note by tonyhughes, on 4-Jan-2013 15:16

I highly recommend to install Drupal 7 manually, and not via apt-get...

For all sorts of reasons, including easier staging from dev/test to production, easier backup, and simply a more sane setup.

Subscribe To My RSS Feed