开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜