.htaccess 要重定向的访问规则?
我有一个类似于.htaccess 要重定向的访问规则?,.htaccess,.htaccess,我有一个类似于www.example.com/hello-1/hey-2的链接,现在我想做的是从www.example.com/hello-1/hey重定向到此链接。如何为此编写htaccess规则。我尝试过搜索它,尝试过同样的方法来减少index.php,但是没有成功。谢谢 看,基本上我希望人们在键入www.example.com/hello-1/hey这是我的旧链接时被重定向。我希望它们被重定向到www.example.com/hello-1/hey-2,在这里2很重要,因为它为我传递了一个
www.example.com/hello-1/hey-2
的链接,现在我想做的是从www.example.com/hello-1/hey
重定向到此链接。如何为此编写htaccess规则。我尝试过搜索它,尝试过同样的方法来减少index.php,但是没有成功。谢谢
看,基本上我希望人们在键入www.example.com/hello-1/hey这是我的旧链接时被重定向。我希望它们被重定向到www.example.com/hello-1/hey-2,在这里2很重要,因为它为我传递了一个参数。基本上,这样做是可能的
RewriteEngine On
RewriteRule ^hello-1/hey$ hello-1/hey-2 [R=301,L]
另外,你能举个例子吗?