Forum Moderators: phranque
Here's the rule:
RewriteRule ^([0-9]+)-[a-zA-Z0-9-]+/([0-9]+)-[a-zA-Z0-9-]+.html$ /MARKETPLACE/category21.php?catid=$2 [L]
An examlple of the url:
205-body-interior/2874-air-bag-suspension-kit.html
I want to be able to have links to
205-body-interior/2874-air-bag-suspension-kit.html?page=2 and have that page variable sent to the PHP page along with the catid (which is working).
So far when entering the URL with the additional "?page=2", it just gets stripped out.
Anybody out there good with mod rewrite? Please?
[edited by: LBmtb at 8:53 pm (utc) on June 14, 2007]
Also, for the sake of efficiency, consider using the [NC] flag to make the pattern-matching case-insensitive. This will reduce the time needed to compare the two instances of [a-zA-Z0-9-] by one-third. Also, escape literal periods outside of alternate groups as shown; Unescaped periods mean "match any single character" except inside [alternate-groups].
RewriteRule ^([0-9]+)-[a-z0-9-]+/([0-9]+)-[a-z0-9-]+\.html$ /MARKETPLACE/category21.php?catid=$2 [NC,QSA,L]
^([^-/]+)-[^-/]+/([^-/]]+)-[^-/.]+\.html$
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim