Rewriting URLs which contain ? and &

Discuss practical ways rearrange URLs using mod_rewrite.

Rewriting URLs which contain ? and &

Postby Guest » Fri Jan 09, 2004 12:30 pm

I'm passing an URL like:

/testing/1234-http://xyz.com/page?var=1&var=2

.htaccess says:

RewriteEngine on
RewriteRule ^([a-f0-9]+)-(.+)$ /testing/index.php?linkres=$1&link=$2

and index.php says:

$link=$_REQUEST['link'];
$linkres=$_REQUEST['linkres'];
echo $linkres.'<br>';
echo $link;

reads linkres (1234) this is a checksum
and wants link to be: http://xyz.com/page?var=1&var=2

but because of the ? and & in the link, link=http://xyz.com/page

how do i get the whole of the rest of the URL to be passed?

for simplicity, index.php says:

TIA
Guest
 

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 18 guests

cron