如何使用 .htaccess 调用不同的索引文件?
我需要在我的网站上放置一个链接,我需要加载主页但具有不同的索引文件(index2.html),但网址是 www.mysite.com 而不是 www.mysite.com/index2.html
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.com\index2.html$ [NC]
RewriteRule ^$ /index2.php [L]
以上规则无效。
DirectoryIndex newfile.php newfile.html site-down.php
应该在 .htaccess 中解决问题
我认为使用 htaccess 无法实现您要查找的内容,它完全基于浏览器。所以在您的 index2.html 文件中将其添加到正文中,这是 HTML5,所以我不确定它是否适用于 ie9。
<script> window.history.replaceState('Object', 'Title', '/'); </script>