views:

39

answers:

1

It's hard for me to grasp what a rewrite is actually doing. I would like to setup some rules and then be able to throw tests at it and step through it like a debugger.

A: 

As far as I'm aware, there isn't a tool that would let you do that, however, there's a few things you could use that have been helping me a lot.

We all know rewrites are all about regular expressions, and being able to write them properly is a MUST.

Helicon Tech has a tool called Regular Expression Test Utility (in the bottom of the page). it's really good for writing your rules and evaluating them. It will let you use rewrite commands, and will tell you if there are matches, or errors with your evaluations.

Also, as a second tools (for quick regexps), i use a tool called regexr by gskiner. it's available as an online version, or my favourite desktop version. It won't check rewrite evaluations, but will let you write your regular expressions, and highlight the results, so when for example I want to redirect a user that hits the page:

http://www.website.co.uk/blog/index.cfm?article=1

with

http://www.website.co.uk/blog/article/1

I simply use it to test my matches as such: alt text

Hope this help you

Marcos Placona