views:

61

answers:

1

Hi,

I want to test the effects of my RewriteRules without going through all the trouble of setting up a vhost and a RewriteLog and throwing URLs at the browser (or curling them).

But I don't just wanna test regular expressions. I want my URLs to actually go through Apache's mod_rewrite stack, and I want to see the response that would come out of it.

Awesome if I could get some trace of which rules acted on the URL, with which order, and what the interim results were. (I guess most of this appears in the rewrite log, but I wanted to avoid that setup)

Is there any tool for this out there?

I'm ok with it not being able to handle RewriteConds, since those generally rely on the request headers and whatnot.

+2  A: 

I haven't come across a mod_rewrite validator, but setting up a vhost may have been quicker than posting here :)

Your best bet is unit testing. Provide rewrite rules and a list of expected results then get a regular report. I don't know your environment but Google results look promising.

Hope that points you in the right direction!

Al
Indeed, results look interesting. And it's ruby. And ruby is purrrty.
kch
The problem with unit testing, though, is that it's mostly a validator of existing code. What I want is something more flexible, that allows me to play with the rules and see what happens.
kch
Then stop procrastinating and play :D Keep an eye on your server logs for useful error output and see if results are as you expect in your web browser. I'm sorry I can't help more! I think what you really want comes with experience.
Al
Yes, well, generally I tail -f the rewrite log, send it to the background, and use curl -Iq to test. I'm just wondering if there's a tool out there that removes the friction. This is not really an issue I'm currently having. But an issue with coworkers that don't have the same finely-tuned-over-the-years setup that I do.
kch
I think you've answered your own question :) Is there a way you could provide a front-end for your setup so others can use it? Or package it up and let others install? Or atleast document it for the rest of the team?
Al
Also, http://stackoverflow.com/questions/618941/modrewrite-gui, as Gumbo mentioned. Indeed, sounds like a good app for someone with free time to develop.
kch