我想將任何以index.html結尾的網址的請求定向到/。我在服務器上有一個域。用.index.html指向所有網頁請求至/
例子:
- 如果有人想www.thissite 「www.thissite.com/index.html--it是,如果有人想針對www.thissite.com/ 和
- 。」 .COM/anyword /index.html"--it針對www.thissite.com/。 ,如果有人想
- 「www.thissite.com/ folderdoesntexistonthissite /index.html"--it針對www.thissite.com/。
什麼是.htaccess代碼會啓用此功能? (無論是rewritecondition和重寫規則)
這並不完全做的工作:
RewriteCond %{THE_REQUEST} index\.html [NC]
RewriteRule index\.html$ http://www.thissite.com/$1 [R=301.L]