简体   繁体   English

Apache htaccess使用参数删除内部重定向上的尾部斜杠

[英]Apache htaccess remove trailing slash on internal redirect with parameter

I have a subdirectory called /al on my website, which I wish to redirect to the main page, with a language setting. 我的网站上有一个名为/ al的子目录,我希望使用语言设置将其重定向到主页。

So I have the following rule: 所以我有以下规则:

Redirect permanent /al /?lang=en

But after verification with cURL, I am getting sent to /?lang=en/ instead. 但是在使用cURL验证后,我却被发送到/?lang=en/ How can I remove the trailing slash? 如何删除斜杠?

RedirectMatch用于正则表达式功能:

RedirectMatch 301 ^/al/?$ /?lang=en

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM