RewriteCond vs. RewriteRule

I’m trying to get an HTACCESS file to work correctly in my development environment and have been going through the Apache documentation trying to understand how the RewriteCond and RewriteRule statements are related to one another.

For example, do all RewriteRule statements require a RewriteCond statement in order to be processed correctly?

Any explanation on both would also be appreciated.

W22,

You’ve read my tutorial, haven’t you? The RewriteCond statements can be ANDed with a RewriteRule to make it more effective (exclusions, etc) but the RewriteRule is what does the heavy lifting (redirection). No, a RewriteCond is NOT required, it just makes the mod_rewrite block statement far more powerful.

Regards,

DK