PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This link isn't working. It opens the page, but it doesn't see it as page 2, it only sees it as Page one.
Even if I put code into the top to see what page it sees, it's always one. I've tried the page line wtih QSA, but it doesn't work.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
QSA = Query String Append. If you're rewriting /foo/bar?stuff=baz, you need QSA to keep ?stuff=baz after the rewrite.
L = Last. Further rules will not be applied.
The reason the order matters is because of the regular expressions being used. More specific rules need to come first to avoid getting caught by less specific rules. In your case, /type-of-product/foo/page/2 matches
[text]RewriteRule ^type-of-product/([^/]+) /index.php?page=type-of-product&producttype=$1 [QSA][/text]
gets rewritten to /index.php?page=type-of-product&producttype=foo, which then does not match the second rule. Reversing the order means it matches the intended rewrite rule, gets rewritten, and further rewrite attempts are halted due to the L instruction.