I m using first time url rewriting concept..

i m getting some errors when i used different symbols in url..
$title="sachin's best shots KKR : MI ? ";

here when i use normal text (with out any symbols) ..this is working fine..but, when i use (?,",',:)...page can not be displayed..getting error...

please check the below code...

php code @ link

index-id-<?php echo $tr_id; ?>-name-<?php echo urlencode($title); ?>.htm


RewriteRule index-id-(.*)-name-(.*)\.htm$ index.php?id=$1

plz tell me wat i need to do...
i m struggling 4 last couple of days...

Hi liamfriel,

i m phasing problen only when i used ( :, ? , !, | )...these type of symbols...there is no problem when i used (', ")...

plz look into the code...


<a href="index-id-<?php echo $tr_id; ?>-name-<?php echo htmlentities($url); ?>.htm"> xxxxxxxxxxx </a>


Google chrome error:

HTTP - 404 Page Not Found
Sorry, the page you were looking for cannot be found.

I have been reading that some browsers retain the HTML entities of encoded chars try:

htmlentities() or htmlspecialchars().

before encoding.