Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are ifModule mod_rewrite tags redundant in .htaccess mod_rewrite files

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>
like image 566
ina Avatar asked Jul 24 '10 00:07

ina


1 Answers

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.

like image 96
Residuum Avatar answered Nov 09 '22 12:11

Residuum