Hello there,
I'm trying to make some url rewrite but i'm having some problem with it.
I have four rules on htaccess where the first two works and the last two, are not working. I putted print_r($_GET) on the file to see what is getting and i saw that the php requests informations about a wrong variable that i have not putted on the request. Let me example it:
I have the php file:
<li><a href="<?php echo constant("SITE_PATH");?>/my-own-preffix-<?php echo $row['catUrl'] ?>-<?php echo $row['catiID'] ?>.html"><?php echo $row['catName']; ?> </a></li>
The htaccess file looks like this:
RewriteRule ^my-own-preffix-([a-zA-Z0-9_-]+)-([a-zA-Z0-9_-]+)-([a-zA-Z0-9_-]+)-([0-9]+)\.html$ offer.php?caturl=$1&countryurl=$2&offerurl=$3&offerid=$4 [NC,QSA,L]
RewriteRule ^my-own-preffix-([^-]*)-([^-]*)\.html$ /offer.php?countryurl=$1&countryid=$2 [L]
RewriteRule ^my-own-preffix-([a-zA-Z0-9_-]+)-([^-]*)\.html$ /offer.php?caturl=$1&catid=$2 [NC,QSA,L]
RewriteRule ^my-second-own-preffix-([a-zA-Z0-9_-]+)-([0-9]+)\.html$ /offer.php?caturl=$1&seccatid=$2 [NC,QSA,L]
When i tried to access the page domain/my-own-preffix-category-name-continue-2012-5.html , i get a wrong page with this output of print_r($_GET):
Array ( [caturl] => category-name [countryurl] => continue [offerurl] => 2012 [offerid] => 5 )
This output seems that the php/browser/url... requests wrong informations and not ones that it should request.
This happened when the offerid exists (offerid is in another table of db and have not to do with the one that i'm requesting). If the offerid is not found, the browser got a 404 error.
Can someone help me on this issue please?
Thank you in advance!