simple question, my url is
www.site.com/page--3
I need the rewriterule to read "/page--3" as two different values.
I have this working: RewriteRule ^/?([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ index.php?page=$1&subpage=$2
This gives me the values 'page' and '3' from www.site.com/page/3.
how do i get the rewriterule to read the '--' as a seperator for the values so that i can read the page and number values? Simply changing the / to -- does not work, does it need to be in some reg expression or escape value?
Any help appreciated
Not sure if I understand you correctly, but assuming I do, this should work:
^/([a-zA-Z0-9-]+)(/|--)([a-zA-Z0-9-]+)$
It will match both www.site.com/page--3
and www.site.com/page/3
. Note, though, that in difference from your original regex, $2
will be the separator and the values you're looking for are in $1
and $3
.
RewriteRule ^products/([0-9][0-9])/$ index.php?page--$1