简体   繁体   English

使用Nginx重写删除URL的最后一部分

[英]Drop last part of URL with Nginx rewrite

If I have the following URL: 如果我有以下网址:

https://kl-office.com/directory

How can I configure Nginx to rewrite the above URL as: 如何配置Nginx以重写上述URL:

https://kl-office.com

You could try this: 你可以试试这个:

rewrite ^.*$ / permanent;

Although, this will rewrite any request to / 虽然,这将重写任何请求/

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

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