What are the potential pitfalls of using mod_rewrite to redirect URLs with query strings in PHP?

Potential pitfalls of using mod_rewrite to redirect URLs with query strings in PHP include losing the original query string parameters during the redirection process. To solve this issue, you can use the [QSA] (Query String Append) flag in your RewriteRule to ensure that the original query string parameters are preserved and appended to the redirected URL.

RewriteEngine On
RewriteRule ^example$ /newpage [L,QSA]