如何使用.htaccess调用不同的索引文件?如何使用.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]
上面的规则没有工作。
怎么办? – marius 2013-03-13 13:56:08
只是写这行到一个新的.htaccess文件应该工作,我没有尝试实际上,我使用nginx,但据我记得,它就像这样在Apache。不需要rewritecond和rewriterule来做到这一点。 – sinanislekdemir 2013-03-13 14:04:00
我试试。它没有工作。我需要访问myiste.com/index2.html来加载index2.html内容,但在浏览器网址上仅查看www.mysite.com而不是myiste.com/index2.html – marius 2013-03-13 14:06:28