I want to rename specific http get parameter since application (NextCloud) changed it from path to dir and I want to preserve compatibility with old links.
Original URL was: https://example.com/index.php/s/public?path=/Path/To/Folder
Target URL: https://example.com/index.php/s/public?dir=/Path/To/Folder
I've tried many mod_rewrite rules, best was:
RewriteCond %{QUERY_STRING} (^|&)path=([^&]+)(&|$)
RewriteRule ^/index\.php/s/public$ /index.php/s/public?dir=%2 [L,R=301]
Which relativelly worked but has problems with escaped slashes in the parameter path.
For example, if link was: https://example.com/index.php/s/public?path=%2FPath%2FTo%2FFolder
it was rewrited to: https://example.com/index.php/s/public?dir=%252FPath%252FTo%252FFolder (chracter % was escaped).
Please help how to stop escaping already escaped characters. Thank you.
BorBNEflag then?