Forum Moderators: phranque

Message Too Old, No Replies

Mod_rewrite apache/php problem

Query string gets lost during redirect

         

driesie

9:42 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



I have a problem with Apache/Mod_rewrite and php.

I have the following rule:
RewriteRule ^cat/(.*)$ list.php?catId=$1 [PT]

This works fine on my local installation (apache 1.3 win2k), but when I move it to my production server (apache 1.3 - RedHat - Cobalt RAQ3), it doesn't work anymore. It seems that it does the redirection but it doesn't pass the querystrings to the script. It doesn't return anything when I try to loop through the $_REQUEST array in PHP. The strange thing as well is that when I try to print the $_SERVER['PHP_SELF'] value, on the working version it return list.php, on the non-working version it returns /cat/... and the non-working version returns an empty string for $_SERVER['QUERY_STRING']

Has anybody seen this problem or does anybody know what the cause could be?

Thanks!

Alternative Future

10:05 pm on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi and welcome to WebMasterWorld driesie,

Have you tried adding the RewriteBase:

RewriteEngine on
RewriteBase /cat
RewriteRule ^cat/(.*)$ list.php?catId=$1 [PT]

I am not fully sure of all the rules but thought this might be an idea till someone that knows more than me comes along :)

HTH,

-gs