如何使用.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