apache – What is [QSA] and similar in RewriteRule for?

Question:

I have as an example the following RewriteRule ^(Home)?/?$ page/php/Home.php [NC,L]
I know the NC is Non-Case(Não diferencia maiúsculas e minusculas) .
L means that if a RewriteRule is true it stops checking.

But I've seen several examples using QSA too and I haven't found an explanation that clarifies what the QSA means and what it's used for.
So I ask, what does this QSA mean? What is your use? Are there other "operators" (I don't know what they're called) besides these? if yes, what are its uses?

Answer:

These "operators" are called 'flags' from apache's mod_rewrite

Here is a list of them ( http://httpd.apache.org/docs/2.4/rewrite/flags.html )

[QSA] stands for Query String Append.

Keep the same query string and add var=val to the end of the URI

RewriteRule ^/pagina /pagina?var=val [QSA]

The URI: /site5/ver.php?pagina=1 will be rewritten to /site/ver.php?site=5&pagina=1

RewriteRule /site5(.*) /site/$1?site=5 [QSA]
Scroll to Top