Need help with regular expressions - URL redirection

Posted by paperless on Stack Overflow See other posts from Stack Overflow or by paperless
Published on 2010-05-23T15:07:58Z Indexed on 2010/05/23 15:10 UTC
Read the original article Hit count: 147

Filed under:
|
|

Hello everyone.

I'm trying to redirect an easy to remember url to a php file but I'm having some trouble with the regex.

Here's what I have at the moment:

RewriteRule ^tcb/([a-zA-Z0-9]{1,})/([a-zA-Z0-9]{1,})/([a-zA-Z0-9]{1,}) /tcb/lerbd.php?autocarro=$1&tipo=$2&dsd=$3

It is working but only if I supply all 3 arguments. I want the last two arguments to be optional so it either works with only the first or all three. I'm hoping you can help me with this.

Thank you very much.

© Stack Overflow or respective owner

Related posts about php

Related posts about regex