Answer the question
In order to leave comments, you need to log in
How to route from /profile?id=1&url=test to /test?
Tell me how to make such a route through htaccess or something else:
Before: /profile?id=1&url=test
After: /test
Accordingly , test is a dynamic name that will change along with id
There is already this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
Answer the question
In order to leave comments, you need to log in
RewriteCond %{QUERY_STRING} (?:^|&)id\=1(?:$|&)
RewriteCond %{QUERY_STRING} (?:^|&)url\=test(?:$|&)
RewriteRule ^profile$ /test? [L,R=301]
RewriteCond %{QUERY_STRING} (?:^|&)id\=1(?:$|&)
RewriteCond %{QUERY_STRING} (?:^|&)url\=(.+)(?:$|&)
RewriteRule ^profile$ /%1? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question