Apache mod-rewrite for shorter urls

Posted by Don on Stack Overflow See other posts from Stack Overflow or by Don
Published on 2009-12-01T21:17:28Z Indexed on 2010/03/22 22:51 UTC
Read the original article Hit count: 286

Filed under:
|
|
|

Is it possible do do something like this with mod-rewrite?

Current url:

www.example.com/Departments/dynamicPage.php?DeptID=10&DeptName=HR

to set up a rewrite so:

www.example.com/hr

could redirect to the above (with the arguments)?

I know I could create an "hr" folder on the root level and put in an html page with a meta refresh, but I hate the extra clutter.

I don't think a .htaccess 301 is possible, but please correct me if I'm wrong. I'm looking for an elegant solution that can be added to for future instances.

© Stack Overflow or respective owner

Related posts about apache

Related posts about mod-rewrite