Why not work rewriterule?

I have a rule to allow the url of the form arenda/arenda alias?selection=alias
To get then get-parameter.
If I add a new rule (the second), then the first rule begins to do the redirect, and it should not be.
Namely redirects with arenda/arenda on alias?selection=alias.
How can I solve this problem ?

# Rewrite arenda/alias -> arenda?selection=alias
RewriteRule ^arenda\/([^\/]+)$ arenda/?selection=$1 [L,QSA]

# Rewrite arenda/ -> arenda
RewriteRule ^arenda/$ /arenda [R=301,L]
April 7th 20 at 15:43
1 answer
April 7th 20 at 15:45
Solution
# Rewrite arenda/ -> arenda
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^arenda/$ /arenda [R=301,L]

# Rewrite arenda/alias -> arenda?selection=alias
RewriteRule ^arenda/([^/]+)$ arenda/?selection=$1 [L,QSA]
Thank you - elvera.Schroeder60 commented on April 7th 20 at 15:48

Find more questions by tags htaccess