Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using a debian etch and apache 2, with webmin.

Mod rewrite is working on my server but when ever i use this code in my .htaccess, i get 500 error.

Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^$ [NC]

RewriteRule ^(.)$$1 [R=301,L]*

I also get this error in the apache error log:

Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Any help is greatly appreciated.

share|improve this question
You do realize that etch has no security support left? – ptman Sep 10 '10 at 17:34
no i didn't know that – Marty Sep 10 '10 at 19:03

Have you enabled the rewrite module?

a2enmod rewrite

share|improve this answer
Additionally, what is your AllowOverride set to in your apache config? – J.Carroll Sep 10 '10 at 17:35
Yes it is enabled, when ever i use that command i get "module is already running" – Marty Sep 10 '10 at 18:38
The defualt file found in /etc/apache2/sites-available is set to ON, here is a portion of it – Marty Sep 10 '10 at 18:40
NameVirtualHost * <VirtualHost *> ServerAdmin webmaster@localhost <Directory /var/www//> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all # This directive allows us to have apache2's default start page # in /apache2-default/, but still have / go to the right place # RedirectMatch ^/$ /apache2-default/ </Directory> – Marty Sep 10 '10 at 18:42
Thanks! That helped me – dobs Feb 27 '13 at 22:03

After you fixed that, you also have a problem with the RewriteRule. The asterisk can't stand at the end of the line. Probably it's missing after the dot so you don't only match single-letter page names.

RewriteRule ^(.*)$$1 [R=301,L]
share|improve this answer
Thanks, but i get the error – Marty Sep 10 '10 at 18:43

Thanks for the info guys after browsing about i solved the problem by adding this line to the bottom of my apache2.conf file, found /etc/apache2:

LoadModule rewrite_module /usr/lib/apache2/modules/

Now it works fine :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.