What is [QSA] for and similar in RewriteRule?

8

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

But I saw several examples using QSA as well and I did not find an explanation that would clarify to me what the QSA means and what its use. So I ask, What does this QSA mean? What is its use? Are there other "operators" (I do not know how they are called) besides these? if so, what are its uses?

    
asked by anonymous 08.10.2014 / 14:31

2 answers

5

These "operators" are called 'flags' of% apache%

Here is a list of them ( link )

[QSA] stands for Query String Append.

Keep the same query string and add mod_rewrite to the end of the URI

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

The URI: var=val will be rewritten to /site5/ver.php?pagina=1

RewriteRule /site5(.*) /site/$1?site=5 [QSA]
    
08.10.2014 / 16:07
-1

Although mdma has responded very well. I would like to add that it is very used in frameworks mainly in PHP to avoid the loss of Query String and still able to continue working with friendly urls. It's worth reading the link provided.

    
15.10.2014 / 00:37