[英]Htaccess add trailing slash to root
Is it possible to add trailing slash to root URL?是否可以将尾部斜杠添加到根 URL? For example, I need https://domain.example
-> https://domain.example/
例如,我需要https://domain.example
-> https://domain.example/
https://domain.example
and https://domain.example/
are the same URL - there is always a slash immediately after the hostname (at the start of the URL-path), even if you do not see it in the browser's address bar (it is present in the HTTP request). https://domain.example
和https://domain.example/
是相同的 URL - 主机名后总是有一个斜杠(在 URL 路径的开头),即使您没有在浏览器的地址栏(它出现在 HTTP 请求中)。
The browser "prettifies" the URL you see in the address bar - this is not necessarily the exact URL that the browser uses in the request.浏览器“美化”了您在地址栏中看到的 URL - 这不一定是浏览器在请求中使用的确切 URL。
See the following question on the Webmasters stack:请参阅网站管理员堆栈中的以下问题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.