Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Problem with regexp in mod_redirect
I can't seem to get a regexp I need to do in a RedirectMatch-statement to work.
Here's what I wanna do:
RedirectMatch Permanent ^/index.php?zone=12&action=do&id=5477$ /[zone-value]/[action-value]/[id-value]
So an URL of http://www.mydomain.com/index.php?zone=B12&action=do&id=5477
redirects to http://www.mycomain.com/B12/do/5477
I tried this (and variants of it):
RedirectMatch Permanent ^/index.php?zone=(B12|A62|A50)&action=(.*)&id=([0-9]+)$ /$1/$2/$3
But it doesn't work.
The values for zone is alpha-numerical from a given set (B12|A62|A50), action is alpha-numerical and the value for id is just numerical.
I hope that made sense. Can somebody help me get this to work? Regular expressions really isn't my strongest skill I'm afraid.
"codito, ergo sum"
0 · ·