Forum Moderators: phranque

Message Too Old, No Replies

rewrite module versus mod.rewrite.c

         

BlueBlizz

10:44 am on Sep 1, 2009 (gmt 0)

10+ Year Member



what is the difference between:
<IfModule rewrite_module> and
<IfModule mod_rewrite.c>

and which one should be used?

jdMorgan

2:23 pm on Sep 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From the Apache documentation the first form --using a "module identifier"-- is available on Apache 2.1 and later. The second form --using a filename-- must be used on Apache 1.x and 2.0.

Be sure you know why you're using <IfModule>, and that you really need it. Its main effect is that, when writing code to be deployed to multiple servers, it will prevent fatal errors on those servers which do not have the named module installed. Of course, the code enclosed in the <IfModule> section won't run on those servers either, and there will likely be other errors or problems because of this.

So in most cases, there is no good reason to use <IfModule> unless you are a large corporation, a hosting company, or a software vendor, deploying code across many servers with different configurations.

Jim