.htaccess 如何将我的网站URL从https://example.com/file.html转换为https://example.com/file?

xsuvu9jc  于 2023-10-23  发布在  其他
关注(0)|答案(1)|浏览(184)

如何将我的网站URL从 https://example.com/file.html 转换为 https://example.com/file?我正在使用Repl.it托管我的网站。
.htaccess文件:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.htm -f
RewriteRule ^(.*)$ $1.htm [L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.asp -f
RewriteRule ^(.*)$ $1.asp [L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.aspx -f
RewriteRule ^(.*)$ $1.aspx [L]
uyto3xhc

uyto3xhc1#

你在GitHub上托管你的网站吗?如果你是,这个视频应该是一个很大的帮助。YouTube: how to put an html...
从8:24分开始

相关问题