简体   繁体   English

apache htaccess-尾部斜杠和单个入口点

[英]apache htaccess - trailing slash and single entry point

I need to have one entry point for my application - index.php. 我的应用程序需要一个入口点-index.php。 Before, i used to have such line of code: 以前,我曾经有这样的代码行:

RewriteRule ^(.*)$ /index.php [L]

Now, i need to force trailing slashes. 现在,我需要强制使用斜杠。 I found out, that I can use such line: 我发现,我可以使用这样的行:

RewriteRule ^(.*)$ http://% {HTTP_HOST}/$1/ [L,R=301]

But I want to know, how can I make it work both together. 但是我想知道,我如何才能使其同时发挥作用。

try something like 尝试类似

RewriteRule ^(.*)$ /index.php/$1 [L]

or 要么

RewriteRule ^(.*)$ http://%{HTTP_HOST}/index.php/$1/ [L]

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

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