donatj/Mod-Rewrite-Rule-Generator — pull request #1 by ajpevers (2013-01-30 19:42:35+00:00)
Title: Update of the rule generator

Hello Jesse Donat,

I've updated your mod_rewrite rule generator. It now takes the types of rules into account and there is an option to force the HTTP_HOST condition to appear. This comes in handy if you have one virtual host listening to multiple domain names.

These types are:
- 0: comment
- 1: a rule, a host and query string(s)
- 2: a rule and query string(s) no host
- 3: a rule, a host, no query string
- 4: just a rule, no host, no query string

Rules will appear in the output in this order. This way a rule without query strings cannot overrule the same rule with query strings.

Rules with the most query strings will be placed over those with less query strings

I've used your script a dozen times and with these adaptions it could save a lot of people a lot of time, while it stays simple and small.

Please have a look at my update and, if you like it, please pull it into your repo.