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.

link|improve this question

25% accept rate
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
feedback

migrated from superuser.com Apr 10 '11 at 17:42

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

2 Answers

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

link|improve this answer
feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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