2013-03-13 21 views
0

是否有可能在首頁加載不同的索引文件,並且仍然看起來像瀏覽器中的默認網站名稱,即www.mysite.com for index.html和www.mysite.com for index2.html ?首頁有多個索引文件

+0

肯定。使用.htaccess文件 – egig 2013-03-13 12:06:22

+0

當你說「首頁」時,你的意思是你在服務器上使用[MS FrontPage](http://en.wikipedia.org/wiki/Microsoft_FrontPage),或者你的意思是「第一頁」。 – OffHeGoes 2013-03-13 12:06:41

+0

我的意思是我的網站index.html首先加載。我需要另一個index2.html文件,它會在觸發時(通過另一頁上的按鈕)加載,但瀏覽器看起來與www.mysite.com相同,而不是www.mysite.com/index2.html。如何使用.htaccess文件完成? – marius 2013-03-13 12:25:36

回答

0

您可以使用AJAX來從index2.html

加載內容的更多信息w3schools

+0

雖然瀏覽器仍然會顯示www.mysite.com,因爲我想要它?或mysite.com/index.html,因爲我不需要那個。 – marius 2013-03-13 12:38:29

+0

我的意思是嘗試通過AJAX請求將index2.html中的任何內容加載到index.html。 – merp 2013-03-13 12:53:27

+0

其實我需要在我的網站上添加一個鏈接,它會加載www.mysite.com/index2.html,但我不希望index2.html在瀏覽器url中顯示。 – marius 2013-03-13 13:11:20