Skip to main content

Apache server setup at 1and1

April 29, 2010 by Steve

The default settings for the Apache servers at 1&1 need to be overridden. Drupal provides a .htaccess file which takes care of most settings. You will need to modify that further to get everything working.

Making PHP work

By default, 1&1 uses PHP4, and these days Drupal expects PHP5. Rather than change all the files from *.php to *.php5, as 1&1 suggests, we will modify the .htaccess file to get what we want.

Edit the .htaccess file that came with Drupal and drop these lines in at the top:

# Added for 1&1 hosting
# -- Make PHP5 the default
AddType x-mapp-php5 .php

Making Clean URLs work

Don't close the file yet. The Clean URLs package sets up Drupal to make a nice looking URL for each page, instead of a complicated series of PHP arguments. We want to turn that on before we add any content to the site. Clean URLs requires the Apache server setting mod_rewrite to be functioning correctly.

Since I'm using the cheapest possible hosting, that means Et Melius is sharing server space with plenty of other sites. For shared hosting, mod_rewrite needed the MultiViews option turned off. In your .htaccess file, add this right under the PHP5 line:

# -- required for mod_rewrite to work on shared hosting
#Options -MultiViews

We're not done yet. As it turns out, I also needed to change the RewriteBase setting to get the shared environment of 1&1 to work. Scroll down in the Drupal .htaccess file and find the section that looks like this:

# If your site is running in a VirtualDocumentRoot at,
# uncomment the following line:
# RewriteBase /

Uncomment the RewriteBase setting so that it looks like this:

# If your site is running in a VirtualDocumentRoot at,
# uncomment the following line:
RewriteBase /

Now you're done. Save your .htaccess file and put it on your live site.

Caution: I discovered that the custom .htaccess file breaks Drupal on my local machine. I had to comment all that stuff back out again for it to work properly on my computer. So the .htaccess file is the only file that is different between my test machine and the live server.


  • @rosamundlannin I make regular chili but use that veggie crumble meat substitute stuff. 5 years 2 weeks ago
  • @Snarky_Geek Since I was awake at 4:30 this morning, and finally just gave up and went to work around 5:45, I feel your pain. 5 years 3 weeks ago
  • One of the Chicago office dogs really wants to play this morning @the_nerdery, keeps bringing toys over to try to start something. 5 years 11 weeks ago

Premium Drupal Themes by Adaptivethemes