开发者

htaccess - Remove trailing period

开发者 https://www.devze.com 2023-02-09 15:38 出处:网络
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:

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

精彩评论

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