Forum Moderators: phranque
But when I try using it at home (WAMP installation, Windows, Apache, MySQL, PHP) I run into problems as the values I have assigned to parameters are not read properly if there is more than one value.
Example:
=== .htaccess ===
RewriteEngine on
RewriteRule ^album/(.*)/(.*)/$ /album.php?cat=$1&album=$2
In principle then
[192.168.1.100...] should be interpreted as
[192.168.1.100...]
Instead I get an error message, and if I ask for an output of the parameters with
print_r($_GET);
the result is
Array ( [cat] => ealbum/e/4/album=4 )
I have activated RewriteLog, and this is the important bit of the log (added line breaks for better readability):
add path-info postfix: c:/programme/wamp/homepages/album
-> c:/programme/wamp/homepages/album/e/4/
strip per-dir prefix: c:/programme/wamp/homepages/album/e/4/
-> album/e/4/
applying pattern '^album/(.*)/(.*)/$' to uri 'album/e/4/'
rewrite album/e/4/
-> /test.php?cat=ealbum/e/4/album=4
split uri=/test.php?cat=ealbum/e/4/album=4
-> uri=/test.php, args=cat=ealbum/e/4/album=4
add path-info postfix: /test.php
-> /test.php/e/4/
Can anybody here help me with the interpretation of why it goes wrong?
Welcome to WebmasterWorld [webmasterworld.com]!
This is very strange.
Only two things come to mind:
First, are you sure that the code you posted has been uploaded to your server?
Second, you may (somehow) have a corrupted module on your server. I'd suggest you try re-loading it.
I'd also recommend changing your rule to the following, which will be faster. But what you already have should work, this is just a speed-up:
RewriteRule ^album/([^/]+)/([^/]+)/$ /album.php?cat=$1&album=$2 [L]
First, are you sure that the code you posted has been uploaded to your server?
Second, you may (somehow) have a corrupted module on your server. I'd suggest you try re-loading it.
RewriteRule ^album/([^/]+)/([^/]+)/$ /album.php?cat=$1&album=$2 [L]