我怎样才能让它发挥作用?我想在目录中使用一个尾随斜杠,但在文件中没有斜杠。那么test.php/
变为test.php
而test/folder
变为test/folder/
?现在我编写了这段代码,但这不起作用:
# Remove trailing slash from files
RewriteCond %{REQUEST_URI} ^/([^/]*)([.]{1})([^./]{1,})/$
RewriteRule . %1.%3 [R=301,L]
# Add trailing slash at directories
RewriteCond %{REQUEST_URI} ^/([^/.]*)$
RewriteRule . %1/ [R=301,L]