htaccess - Remove trailing period
How do I remove the trailing period (dot) with htaccess?
If a visitor goes to http://example.com/mypage. it'll give a 404 error. I already have the following in my htaccess file:
RewriteRule ^(.*)\.html$ http://example/$1 [R,L]
RewriteRule ^(.*)\.htm$ http://example.com/$1 [R,L]
I assumed adding this would work, but it do开发者_开发知识库esn't:
RewriteRule ^(.*)\.$ http://example.com/$1 [R,L]
Thanks in advance.
RewriteRule ^(.+)\.$ http://www.example.com/$1 [R=301,L]
will remove a trailing dot
精彩评论