What is the purpose of the [QSA] flag in a RewriteRule in PHP and how does it affect the URL rewriting process?
The [QSA] flag in a RewriteRule in PHP stands for "Query String Append" and is used to append the existing query parameters to the rewritten URL. This is useful when you want to pass the original query parameters along with the rewritten URL. It ensures that the existing query parameters are not lost during the URL rewriting process.
RewriteEngine On
RewriteRule ^page/([^/]+)/?$ index.php?page=$1 [QSA]