.htaccess仅显示文件,不显示实际内容

时间:2018-11-19 09:22:02

标签: apache .htaccess mod-rewrite

我在.htaccess中设置了此代码

RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]

但是,当我尝试访问www.example.com/example时,它仅显示该页面中的文件,而不显示实际内容。我只是想让它成为www.example.com/example而不是www.example.com/example.html

0 个答案:

没有答案
相关问题