Dyce & Sons Ltd.

Helping IT since 1993

The Joys of .htaccess and 1&1

Wednesday 28th August, 2013

Here’s a quick one for anyone experiencing the same Error 500 issue on a hosted 1&1 website. Don’t bother calling tech support. If you’re using a .htaccess file, then chances are you doing it by the book - e.g.

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_URI} !(\.css|\.js)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>

This will FAIL bigtime. The code is valid, it’s just 1&1’s apache support is sub-par. Instead, do without the IfModule and it should work beautifully:

RewriteEngine on

RewriteCond %{REQUEST_URI} !(\.css|\.js)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

( Which as I’m sure you know directs everything, except .css and .js files to the index.php file. Now is that going to be a fun site… )