.htaccess 使用htaccess文件删除.html最简单的方法是什么?

.htaccess 使用htaccess文件删除.html最简单的方法是什么?,.htaccess,.htaccess,所以我一直在尝试很多不同的htaccess编码来清理我的url 但是我甚至不能简单地删除.html而不出错 代码Im使用: RewriteCond%{REQUEST_FILENAME}.html-f 重写规则^(+)/$$1.html[L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301] RewriteEngine on RewriteCond %{REQUEST_FILENAM

所以我一直在尝试很多不同的htaccess编码来清理我的url

但是我甚至不能简单地删除.html而不出错

代码Im使用: RewriteCond%{REQUEST_FILENAME}.html-f 重写规则^(+)/$$1.html[L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301]

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)/$ $1.html [L]
代码我希望清理:

 <area shape="poly" coords="3,612,78,557,118,627,5,708"     href="collabwitus.html" />

htaccess有点新,希望得到一些帮助

我正在通过hostgator从文件管理器进行所有工作,因此使用文件管理器在更逐步的版本中构建一个答案将是非常棒的

试试这个:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

请输入以下代码:

RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+(.*?/)?(?:index)?(.*?)\.html[\s?/] [NC]
RewriteRule ^ /%1%2 [R=302,L,NE]

这个代码对我有用:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

我应该如何处理名为.html的文件?如果我不使用.html重命名它们,它们只显示代码,但不加载实际页面。。。如果我不重命名它们,那么它们就根本不起作用了…谢谢,我所要做的就是从网站上的任何链接中删除.html