I’m trying to modify a URL and variable, and I’m not sure if I’m running into syntax errors or just using the wrong expressions.
I’m trying to turn this:
http://www.mydomain.com/trainings/12345
into this:
http://www.mydomain.com/remote.php?page=abcde&var=12345
The remote.php?page=abcde is static and will never change. So just need to pass that variable and strip out the /trainings in the URL. The 12345 will change.
I’ve tried the following with no luck:
RewriteCond %{QUERY_STRING} /trainings/(.*)
RewriteRule remote.php?page=abcde remote.php?page=abcde&var=%1 [QSA,L]
I’ve also tried some variations of the above with no success.
I’m pretty sure I’m using the wrong syntax. Any help is much appreciated!!
This should work