.htaccess 如何使用htaccess重定向此URL?

.htaccess 如何使用htaccess重定向此URL?,.htaccess,.htaccess,我想重定向以下URL http://www.example.com/friends/view.php?l=ka&id=21903 进入本页 http://www.example.com/hello.html 如何使用htaccess执行此操作?您可以在htaccess中使用以下规则: RewriteEngine on RewriteCond %{THE_REQUEST} \s/friends/view\.php\?l=ka&id=21903\s [NC] RewriteRu

我想重定向以下URL

http://www.example.com/friends/view.php?l=ka&id=21903
进入本页

http://www.example.com/hello.html

如何使用htaccess执行此操作?

您可以在htaccess中使用以下规则:

RewriteEngine on

RewriteCond %{THE_REQUEST} \s/friends/view\.php\?l=ka&id=21903\s [NC]
RewriteRule ^ http://example.com/hello.html? [L,R]