Mod_rewrite: QSA flag breaks configuration

I have this rewrite rule for web service:

RewriteEngine on RewriteBase / RewriteRule ^service/(.*)$ blabla/service.php?request=$1 [L] 

It works fine, but now I need to add a query string and find the QSA flag. I added it next to L, but it seems to have broken mod_rewrite, because I get 500 from Apache, and my php script is not reached.

 RewriteRule ^service/(.*)$ blabla/service.php?request=$1 [QSA, L] 

What am I doing wrong?

+4
source share
1 answer

... it seems that mod_rewrite does not like spaces between flags.

 RewriteRule ^service/(.*)$ blabla/service.php?request=$1 [QSA,L] ^ 

This fixed the problem (sigh).

+5
source

Source: https://habr.com/ru/post/1436236/


All Articles