采用了大多数.htaccess答案来删除.html扩展名,但仍然没有任何更改

采用了大多数.htaccess答案来删除.html扩展名,但仍然没有任何更改,.htaccess,.htaccess,我正在尝试从我的子页面中删除.html扩展名。当我单击这些页面时,我希望它们不显示.html 这就是我的.htaccess在此时此刻的样子。有很多答案可以解决我的问题。为了给你一些背景知识,我正在从头开始开发这个网站,并使用filezilla作为我的FTP解决方案,同时使用dreamhost作为我的托管解决方案。我已将.htaccess与index.html文件夹放在同一文件夹中 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f Rewri

我正在尝试从我的子页面中删除.html扩展名。当我单击这些页面时,我希望它们不显示.html

这就是我的.htaccess在此时此刻的样子。有很多答案可以解决我的问题。为了给你一些背景知识,我正在从头开始开发这个网站,并使用filezilla作为我的FTP解决方案,同时使用dreamhost作为我的托管解决方案。我已将.htaccess与index.html文件夹放在同一文件夹中

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
######################################################################
RewriteRule /(.+)(\.html)$ /$1 [R=301,L] 
######################################################################
RewriteEngine on
RewriteBase /
RewriteCond %{http://www.proofers.co.uk/new} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://www.proofers.co.uk/new/$1 [R=301,L]
######################################################################
#Section 1
RewriteEngine On
IndexIgnore *
Options +FollowSymLinks -Multiviews -Indexes
######################################################################
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

# Protect .htaccess
<Files .htaccess>
    order allow,deny
    deny from all
</Files>
重新编写引擎打开
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)\.html$/$1[L,R=301]
######################################################################
重写规则/(.+)(\.html)$/$1[R=301,L]
######################################################################
重新启动发动机
重写基/
重写秒%{http://www.proofers.co.uk/new} !(\.[^./]+)$
重写cond%{REQUEST_fileNAME}-D
重写cond%{REQUEST_fileNAME}-F
重写规则(.*)/$1.html[L]
重写cond%{u请求}^[A-Z]{3,9}\/([^.]+)\.html\HTTP
重写规则^([^.]+)\.html$http://www.proofers.co.uk/new/$1[R=301,L]
######################################################################
#第一节
重新启动发动机
IndexIgnore*
选项+后续符号链接-多视图-索引
######################################################################
重写cond%{QUERY_STRING}base64_encode.\(.*)[或]
重写条件%{QUERY\u STRING}(\\\\%3E)[NC,或]
重写条件%{QUERY\u STRING}全局(|\[|\%[0-9A-Z]{0,2})[或]
重写条件%{QUERY\u STRING}\u请求(|\[|\%[0-9A-Z]{0,2})
重写规则^(.*)$index.php[F,L]
#保护.htaccess
命令允许,拒绝
全盘否定
试试:

RewriteEngine On

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html[\s?] [NC]
RewriteRule ^ %1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [L]

对于所有html页面。询问是否只针对一个目录…

您可以开始更详细地解释您正在尝试做什么,您有哪些页面/URL以及它们现在给您提供了什么行为吗?当然,我会更新问题。您的引擎已经启动。您不需要继续执行
重新编写引擎
。它不会停止“更多信息”。好的,谢谢,我现在明白了。当你访问/报纸时会发生什么?