Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ^xyz.com

RewriteCond %{HTTP_HOST} ab|bc|ac
RewriteRule ^abc.net


<IfModule>

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 superuser.com Apr 10 '11 at 17:42

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

1  
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
2  
Shouldn't you have a closing / on the <IfModule>? –  emgee Apr 8 '11 at 17:02
    
@emgee did that, still have the issue –  Jean Apr 8 '11 at 17:34

2 Answers 2

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

 
discard

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.