IfModule: When Do We Need to Specify It?
Do you need to enclose your rewrite rules with the following?
<IfModule mod_rewrite.c> # Rewrite rules here. </IfModule>
Assuming mod_rewrite wasn’t turned on, the rules won’t be executed anyway, no?
If mod_rewrite wasn’t turned on, the rules would generate an error upon starting.
Whenever there’s reason NOT to be sure a module is loaded (“generic” .htaccess used on multiple servers for example), the IfModule tags are useful. If you’re sure the module is loaded, there’s no need for the tags.
Answered By – PtPazuzu