I would like to redirect via .htaccess, old URL is like
https://www.domain.de/something/?action=login¶ms=1
New URL should be like:
https://www.domain.de/something/login.php?params=1
So, in short words:
Remove: ?action=
Use action text as script name: login should be the script name login.php
All following parameters should be appended in unchanged way.
Any ideas for that? I guess it must be split into two rules?
I tried like that, but "something" and the action param are still added after login.php? and I would have to implement for each script name manually:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} .*action=login.*
RewriteRule ^(.*) https://%{HTTP_HOST}/something/login.php?$1 [QSA,L]
</IfModule>
You may use this redirect rule in your site root .htaccess:
Once you verify it is working fine, replace
R=302toR=301. Avoid usingR=301(Permanent Redirect) while testing yourmod_rewriterules.However if you don't want full redirect (URL to change in browser) then remove
Rflag from this rule.