Answer the question
In order to leave comments, you need to log in
How to change url with GET parameters in .htaccess?
Hello.
There is url
a kind https://site.ru/profile?username=georgii
.
How to get from this https://site.ru/profile/georgii
?
And how can (I think that this is already done not through redirects) https://site.ru/profile?username=georgii
be replaced with https://site.ru/georgii
?
Thanks
Answer the question
In order to leave comments, you need to log in
Specifically for TK
RewriteCond %{QUERY_STRING} (^|&)username\=georgii($|&)
RewriteRule ^profile$ /profile/georgii? [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)username\=(.+)($|&)
RewriteRule ^profile$ /profile/%2? [L,R=301]
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
</IfModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question