Rewrite query string "?x=y" style to "/x/y" style

Posted by Ross on Stack Overflow See other posts from Stack Overflow or by Ross
Published on 2010-05-26T19:15:25Z Indexed on 2010/05/26 19:41 UTC
Read the original article Hit count: 300

Filed under:
|
|
|

I have a PHP MVC framework I've built from scratch which uses the traditional domain.com/controller/action URL routing. While I'm currently handling the below conversion in the router I'd like to replace them in the URL for cosmetic reasons.

For example:

controller/action?filter=bank

Becomes:

controller/action/filter/bank

I've done a bit of experimentation with a regex but can't seem to find a match. I'm also not sure how to rewrite it using RewriteCond.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about apache

Related posts about mvc