Need help with RewriteRule – want to pass part of url as parameter
-
Hope this belongs here. Need help with my htaccess code.
I want to turn these URLS:
/mysite/site1/offer/
/mysite/site2/offer/
/mysite/site1/offer/?name=tom&email=test@test.cominto to this:
/mysite/site1/?page=offer
/mysite/site2/?page=offer
/mysite/site1/?page=offer&name=tom&email=test@test.comSo that wordpress ignores ‘/offer/’ and instead passes the url parameter to the custom template.
Can this be done?
I tried this:
RewriteRule /mysite/([^/]+)/([^/]+)/$ /mysite/$1/?pg=$2 [L,QSA,NC]But I know it’s missing the bit to capture the other url params but not sure how to write this.
Any help is greatly appreciated. Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Need help with RewriteRule – want to pass part of url as parameter’ is closed to new replies.