Greetings,
I have a tricky situation with some mod_rewrite stuff.
I have an URL structure set up with certain (keywords) or parameters that coorespond to columns in the database:
http://www.mysite.com/coins/(denomination)/(coin type)/(year)-(mintmark)/(misc)/
Now I have two URLs and pages like this:
<a href='http://www.mysite.com/coins/half-cents/liberty-cap/1794-P/high-relief/'>1794 P</a> - (high relief)
<a href='http://www.mysite.com/coins/half-cents/liberty-cap/1794-P/'>1794 P</a>
The only difference is that the top URL has a (misc) field and the bottom one has a NULL misc field, hence I did not want to create an URL like with an empty space between the end slashes:
<a href='http://www.mysite.com/coins/half-cents/liberty-cap/1794-P//'>1794 P</a>
The problem is when I click on the bottom link, there is no information being stored into the (misc) parameter, hence the database selects the top result with the “high relief” field rather than the one with the NULL and I get sent to the wrong page.
Here is my current rewrite code:
RewriteRule ^coins/([^/]*)/([^/]*)/([^/]*)-([^/]*)/([^/]*)/$ /coins.php?denomination=$1&type=$2&year=$3&mintmark=$4&misc=$5 [L]
Does anyone know how to deal with this type of situation?
Thanks