I need professional help here... Here's the situation... I have product URL's going to detail pages. On that page it breaks out into sub-sections, at times it also carries extra parameters in the query string other than "v" and "fa"... note that "v" is an alpha-numeric product ID, and "fa" is the sub-section
- res/stat.cfm?v=id (default page)
- res/stat.cfm?v=id&fa=graphs
- res/stat.cfm?v=id&fa=comments
- res/stat.cfm?v=id&fa=whatever
I'm looking to create rule(s) like the following:
- alphanumericID
- alphanumericID/graphs
- alphanumericID/comments
- alphanumericID/whatever
I'm thinking the second parameter after the ID needs to be written as some kind of wildcard so that it will work in any of the above examples??
I'm also looking for these rule requirements:
- no hardcoded rule values (ex: graphs, comments, etc) as they get changed at times.
- make sure the alphanumericID is just that (regex A-Z 0-9), if not, skip rule
- direct access to "res/stat.cfm" forces a "url has moved" host headers then redirects to the rewritten version.
- It would also be nice to be able to access the "res/stat.cfm" directly for testing and development purposes and bypass the redirect... (ex: res/stat.cfm?id=abc123&bypass=1)
Here's what I have so far which is not flexible and error prone.....
Pattern: ^([^/]+)/?$
Rewrite URL: res/stat.cfm?v={R:1}
Clearly this doesn't do what I need it to do and far from flexible... I've been banging my head against the wall trying different things with minimal success. I know there's someone out there that could probably write this up in 2 minutes!
I'd greatly appreciate the help! Thanks big time in advance!
By the way, the site in question is... http://www.cbengine.com