htaccess-for-nginx
htaccess-for-nginx copied to clipboard
QSA in RewriteRule only works if there is already a query string in the destination URL
https://github.com/e404/htaccess-for-nginx/blob/b81c1f1a4573839021284652c75e2a42d008d72a/htaccess.lua#L1229
RewriteRule p/ajax /ajax.php [QSA,L]
Will not work because the script will never append the querystring as it will not get past if new_qs then. So the querystring will be lost.
I need to append a random string to the destination path in order for QSA to work:
RewriteRule p/ajax /ajax.php?x=1 [QSA,L]
This works and passes the incoming querystring to the rewrite url.
This is a duplicate of https://github.com/e404/htaccess-for-nginx/issues/27 which is fixed in P - so you can use that commit.