Hi there
I was hoping someone could give me a solution to the following problem as I'm stuck....
I have a .htaccess file which I use to rewrite search engine friendly URLs into PHP URLs so that the script can use the $_GET values. It looks something like this:
What I want to do is also be able to read querystring variables that may be appended to the search engine friendly URL. For example, the URL could be:Code:RewriteEngine On RewriteRule ^([a-zA-Z0-9-]+)-([0-9]+)-([0-9]+).html$ product_list.php?cid=$2&bid=$3 [L]
CategoryTitleHere-25-3.html?sort=4
So, I changed the .htaccess file to:
This works. BUT, it doesn't work if the sort variable isn't present. How can I change the RewriteCond so that it doesn't matter if there isn't a querystring? Also, how can it be amended to include additional querystring variables such as 'page'? Basically, it needs to work with URLs like this:Code:RewriteEngine On RewriteCond %{QUERY_STRING} ^sort=([0-9])?$ RewriteRule ^([a-zA-Z0-9-]+)-([0-9]+)-([0-9]+).html$ product_list.php?cid=$2&bid=$3&sort=%1 [L]
CategoryTitleHere-25-3.html
CategoryTitleHere-25-3.html?sort=6
CategoryTitleHere-25-3.html?sort=6&page=2
Any help would be much appreciated![]()








Bookmarks