尽管我尽力了,但我似乎无法在网上找到答案。
我最近使用 StackCP 设置了托管,并且我通过 GoDaddy 拥有了一个域。
我正在尝试从我的链接中删除 .html 扩展名。我希望 site.com/terms 将您带到 site.com/terms.html。我已经阅读了很多,到目前为止我已经尝试过这个
RewriteEngine on
Options +MultiViews
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /$1.html [NC, L]
我已经把它放在我的 .htaccess 文件的根目录中了 index.html 和 terms.html 任何帮助表示赞赏。
将其保存在.htaccess文件中,以便从 url 中删除 .html 扩展名。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句