简体   繁体   中英

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.

So I have the following rule:

Redirect permanent /al /?lang=en

But after verification with cURL, I am getting sent to /?lang=en/ instead. How can I remove the trailing slash?

RedirectMatch用于正则表达式功能:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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