Reputation: 55
I am attempting URL Rewriting for a URL with two get parameters, I want to covert a page:
status/mystatus.php?=reference=1234&postcode=LL1+LL2
Into:
status/1234/LL1+LL2
I have tried using the following code:
RewriteRule ^status/([a-z0-9A-Z]+)/([a-z0-9A-Z]+)$ status/mystatus.php?reference=$1&postcode=$2 [NC,L]
But it doesn't seem to be working, so what am I doing wrong? (The module is turned on, I am using Apache)
Upvotes: 0
Views: 79
Reputation: 143856
Try changing the expressions inside the parentheses to [^/]+
so it looks like:
RewriteRule ^status/([^/]+)/([^/]+)$ status/mystatus.php?reference=$1&postcode=$2 [NC,L]
Because [a-z0-9A-Z]
won't match things like "+".
Upvotes: 1