HTACCESS拖延斜线与Kirby



是否可以在kirby cms中使用拖延斜线将URL重定向到URL?如何?

来自

http://www.test.com/page

to

http://www.test.com/page/

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>

这个

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

最后我找到了它,也可以在Local -Host上工作。

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

http://www.paulund.co.uk/using-htaccess-to-force-trailing-slash

相关内容

  • 没有找到相关文章

最新更新