Php 使用Kirby进行htaccess尾部斜杠重定向

Php 使用Kirby进行htaccess尾部斜杠重定向,php,.htaccess,url-rewriting,trailing-slash,kirby,Php,.htaccess,Url Rewriting,Trailing Slash,Kirby,是否可以将不带尾随斜杠的url重定向到带尾随斜杠的url?怎么做 来自 至 htaccess文件 <IfModule mod_rewrite.c> DirectorySlash On RewriteEngine on RewriteBase /test/kirby/ RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L] RewriteRule ^site/(.*) error [R=301,L] RewriteRul

是否可以将不带尾随斜杠的url重定向到带尾随斜杠的url?怎么做

来自

htaccess文件

<IfModule mod_rewrite.c>
DirectorySlash On
RewriteEngine on
RewriteBase /test/kirby/
RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]
RewriteRule ^site/(.*) error [R=301,L]
RewriteRule ^kirby/(.*) error [R=301,L]
RewriteRule ^robots.txt robots.txt [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>

目录斜杠
重新启动发动机
重写基本/测试/kirby/
重写规则^content/(.*)\(txt|md|mdown)$error[R=301,L]
重写规则^site/(*)错误[R=301,L]
重写规则^kirby/(*)错误[R=301,L]
重写规则^robots.txt robots.txt[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^panel/(*)panel/index.php[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)index.php[L]
这个怎么样

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

最后我找到了它,它也可以在localhost上运行

RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

不起作用。我不知道这是否与我在本地主机上工作有关?工作,但不被重定向。