Josh Posted April 6, 2023 Share Posted April 6, 2023 I am using this .ntaccess rewrite rule to prettify the documentation URLs: RewriteRule "^learn/(.+)$" "learn.php?page=$1" This makes it so the URL "https://www.ultraengine.com/learn/Entity" gets treated as "https://www.ultraengine.com/learn?page=Entity". However, if I have trailing arguments like "?lang=lua" they get omitted from the redirected URL. How can I add those into the rewrite rule? I want to use a URL like this: https://www.ultraengine.com/learn/Entity?lang=lua Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted April 6, 2023 Author Share Posted April 6, 2023 This works: RewriteCond %{QUERY_STRING} ^lang=lua$ RewriteRule "^learn/(.+)$" "learn.php?page=$1&lang=lua" RewriteCond %{QUERY_STRING} ^lang=cs RewriteRule "^learn/(.+)$" "learn.php?page=$1&lang=cs" RewriteCond %{QUERY_STRING} ^lang=cpp RewriteRule "^learn/(.+)$" "learn.php?page=$1&lang=cpp" RewriteRule "^learn/(.+)$" "learn.php?page=$1" Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted April 6, 2023 Author Share Posted April 6, 2023 Example: https://www.ultraengine.com/learn/LoadMaterial?lang=lua Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Solution IceBurger Posted April 6, 2023 Solution Share Posted April 6, 2023 You could instead use the QSA flag, like this: RewriteRule "^learn/(.+)$" "learn.php?page=$1" [QSA] 1 Quote i now hate love C++ Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.