Webserver: Apache 2.4 on SuSE 12, multiple vhosts

4 vhosts (2 ssl, 2 http) have RewriteEngine on and some simple rewrite rules.

mod_rewrite is available and active (checked with a2enmod -l)

Problem: if I issued a httpd -t to check the syntax, I received for the two http vhosts a warning:

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

After having added <IfModule mod_rewrite.c> ... </IfModule> lines around the rewrite blocks the warning disappeared.

Question: Why is there no warning with respect to the two ssl vhosts, which also have the RewriteEngine on, but no enclosing IfModule lines?

  • Do the two SSL vhosts work correctly on the appropriate port?
    – MrWhite
    Jul 12, 2018 at 9:35
  • In what order are the various config files loaded? If the http host configs are loaded before the mod_rewrite module, but the ssl hosts are loaded after, that would eplain it.
    – Jenny D
    Jul 12, 2018 at 13:11

1 Answer 1


Uncomment this line in your apache config, or add it if it doesn't exist:

LoadModule rewrite_module modules/mod_rewrite.so

Restart apache.

  • What difference would this make? According to "a2enmod -l" this module is already loaded. The line you proposed is also not set in the ssh-vhosts, and httpd -t does not complain about them...
    – MarkHelms
    Jul 13, 2018 at 10:47
  • 1
    – eeijlar
    Jul 13, 2018 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .