簡體   English   中英

如何隱藏名稱結束 url index.html

[英]How to hidden name end url index.html

我所說的 url 中的姓氏是什么意思,例如 index.html,例如我網站主頁上的 url 鏈接。 結果是這樣的

https://hijaben.insomnia247.nl/index.html

我想刪除或刪除網址的姓氏(index.html)

我嘗試使用 .htaccess 文件,但它根本不起作用。 是不是腳本有問題或者VPS不支持什么的? 解決方案 ..?

文件 .htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html
</IfModule>

不要用不必要的mod_rewrite事情變得過於復雜。 只需使用DirectoryIndex index.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM