Forum Moderators: coopster

Message Too Old, No Replies

mod rewrite not passing variables to php script?

         

scorpion

7:38 am on Oct 28, 2003 (gmt 0)

10+ Year Member



Has somebody encountered this issue?

Given the rule:

rewriteRule ^(.*)-(.*)-(.*)\.html$ index\.php?file=$1&imgno=$2&template=$3 [L]

and the check:

$file = $HTTP_GET_VARS['file'];
echo $file . "<br>";
$imgno = $HTTP_GET_VARS['imgno'];
echo $imgno . "<br>";

The script returns for example 'a-b-c.html' for 'gallery' and "" (null string) for imgno?

In other words, appears as if the $1 takes the whole match instead of splitting it up?

Birdman

9:15 am on Oct 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only problem I see is the escaped period in the rewritten url. You don't need to escape them in the new url, just in the regex part. Hope it helps.

Birdman