Are the following opening/closing tags necessary for .htaccess mod_rewrite's? I've had .htaccess working without those, but just checking up on htaccess tutorials, many include this tag.

<IfModule mod_rewrite.c> ... </IfModule>

Accepted Answer

They are not necessary for mod_rewrite, as unknown directives are not interpreted, so it is more or less a style thing.

The tag can also used to perform test for not available modules with <IfModule !mod_rewrite.c>, so that you can use some other directives in that case.

Written by Residuum
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the community.
It is licensed under cc-wiki