I am getting a annoying problem with rewrite-using cherokee web-server.
I wish to convert:
http://example.com/mypage.phtml?cmd=print => to => http://example.com/index.php?page=mypage&cmd=print
However , the ?-sign messes in the cmd
$_GET : array('page'=>'mypage', '?cmd'=>'print')
Cherokee is set up with:
regexp: ^/(.*)\.phtml(.*)$ internal subst: /index.php?page=$1&$2
So my question: The proper way to "consumeInch the question-mark if there are any.
Try matching it clearly prior to the taking parentheses:
\? is really a literal
?, and also the following
? means "match or 1 occasions".