【发布时间】:2015-06-02 07:45:29
【问题描述】:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
## hide .php extension
# To externally redirect /dir/foo.html to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.html
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_FILENAME}.html [L]
我按照Removing .php file extension with .htaccess file 中的建议使用上面的代码 sn-p 进行 URL 重写。但我无法将培训 / 添加到 URL
例如 www.somewebsite.com/contact 到 www.somewebsite.com/contact/
我要纠正什么?
【问题讨论】: