denoise
denoise

Reputation: 1097

.htaccess working locally, but not on 1and1 server

I uploaded the current .htaccess file to a 1and1 server (actually 1und1.de, but I guess it's the same) and I'm geting a 500 Internal Server Error.

Options -MultiViews 
RewriteEngine On
RewriteBase /lammkontor

RewriteRule ^categories/([^/\.]+)/?$ index.php?url=category.php&cat_url=$1 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/?$ index.php?url=product.php&cat_url=$1&prod_url=$2 [L]
RewriteRule ^categories/([^/\.]+)/([^/\.]+)/recipes?$ index.php?url=recipes.php&cat_url=$1&prod_url=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+\.php)/?$ index.php?url=$1 [QSA]

This .htaccess works perfectly on my local MAMP server.

When I test the CGI-Monitor in the control-center with an example file I get - cgi: File not present or has invalid modes (no output)

The only file working now is index.php

Thanks for your help!

Upvotes: 5

Views: 7393

Answers (3)

Leandre KOFFI
Leandre KOFFI

Reputation: 1

Just put a slash before the url. eg /index.php instead of index.php at the end of the rule

Upvotes: 0

denoise
denoise

Reputation: 1097

Actually I solved my problem adding a slash to the beginning of every Rewrite Rule, like:

RewriteRule ^(.+\.php)/?$ /index.php?url=$1 [QSA]

instead of

RewriteRule ^(.+\.php)/?$ index.php?url=$1 [QSA]

Thanks!

Upvotes: 19

Panama Jack
Panama Jack

Reputation: 24478

By default apache's htaccess rights are off or limited depending on your host. I suspect its your Options -MultiViews causing the error.

Check your httpd.conf and check that MultiViews is allowed like below.

<Directory />
  Options FollowSymLinks
  AllowOverride Indexes Options=All,MultiViews
  Order deny,allow
  Deny from all
</Directory>

Upvotes: 1

Related Questions