Forum Moderators: phranque
original URL:
productsite-games-&-software
RewriteRule:
RewriteRule productsite-(.*)$ destination.php?producttype=$1
In destination.php, the $_GET['producttype'] parameter doesn't contain "games-&-software" like expected. Instead of I receive $_GET[producttype]="games-" and $_GET[-software] which is empty. Also the use of urlencode(URL), htmlentities(URL) or the [NE]-Flag didn't solve this problem.
Welcome to WebmasterWorld!
Try making the rule into an external redirect temporarily, so that you can see what URL is actually being passed into your script:
RewriteRule ^productsite-(.*)$ /destination.php?producttype=$1 [R=301,L]
The next thing to try is to replace the ampersand with another URL-legal character, or perhaps with the word 'and'. Then see how your parameters parse out into the two variables.
Neither of these suggestions is intended as a fix. Rather, they are intended to locate more precisely where the problem is occurring.
We had a thread [webmasterworld.com] here yesterday reporting similar problems with non-latin characters in the URL. I haven't seen this before, and I'm wondering if this problem is new for Apache 2. Are you on Apache 2 or 1.3?
Jim
I use Apache2. Fortunately I have found a solution on a very good german board:
[php-resource.de...]
You just have to type this line in your .htaccess:
php_value arg_separator.input ";", or change it directly in your php.ini or in a script.
Apache causes this problem because it automaticly encodes a decoded URL, so that PHP parses two variables, what PHP shall do while the php.ini value "arg_separator.input" is set to "&". That value tells PHP that the & should be the seperator charatcter between the arguments in the Link. With the line above you can change the separator to any character you want. In this case I choosed the ";". A character that probably will never appear in my links.
Nube2021