在柯比CMS中,是否有可能在不使用尾斜杠的情况下重定向url?多么?
来自
http://www.test.com/page
到
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>发布于 2014-03-13 11:39:31
最后,我找到了它,也在本地主机上工作。
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]http://www.paulund.co.uk/using-htaccess-to-force-trailing-slash
发布于 2014-03-11 10:06:27
这个怎么样?
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]https://stackoverflow.com/questions/22321828
复制相似问题