Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I am running a LAMP server, and this .htaccess is giving me a 500 error. What this does is filter keywords and redirect to the respective domain names.

Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTP_HOST} xy|yz|xz
RewriteRule ^

RewriteCond %{HTTP_HOST} ab|bc|ac
RewriteRule ^


Why does it give me a 500 error, do I have to check if IfModule is installed, or has to be installed.

share|improve this question

migrated from Apr 10 '11 at 17:42

This question came from our site for computer enthusiasts and power users.

show / check Apache error log – jet Apr 8 '11 at 16:24
@jet the error.log /var/www/conf/.htaccess: <IfModule> directive requires additional arguments, referer: localhost/conf/rewrite.php – Jean Apr 8 '11 at 16:26
Shouldn't you have a closing / on the <IfModule>? – user17642 Apr 8 '11 at 17:02
@emgee did that, still have the issue – Jean Apr 8 '11 at 17:34

You didn't properly close the IfModule container. You need to use </IfModule> at the end. You simply forgot the /

share|improve this answer

Things to check:

  • The mod_rewrite module is installed. a2enmod rewrite
  • If your httpd.conf/apache.conf has AllowOverride None set, you'll get an error. I think it's a different error though.
  • You may need to set a RewriteBase directive.
  • Make sure you reload the configuration file as needed — apache2ctl restart
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.