在我.htaccess
文件DirectoryIndex
設置爲/page/main/home.html
的.htaccess DirectoryIndex的網頁鏈接打破
因此,當我去www.thisexample.com
瀏覽器的地址欄中顯示www.thisexample.com
而實際加載www.thisexample.com/page/main/home.html
。這一切都很好,但現在解決了這個問題:
任何.html
無法找到鏈接到home.html
的頁面。換句話說,當我點擊信息鏈接(在主頁上)時,它會查找www.thisexample.com/info.html
(不存在),而不是在瀏覽器地址欄中顯示www.thisexample.com/info.html
,但實際上正在加載www.thisexample.com/page/main/info.html
(此處爲最終目標)。
這可能有助於補充說home.html
沒有問題通過相對路徑找到它的CSS樣式表,只是找不到鏈接。
我在'/ public_html'的'.htaccess'文件中添加了'RewriteRule!^ page/main// page/main%{REQUEST_URI} [L]'。我仍然有'DirectoryIndex/page/main/home.html',否則它只是把我帶到父目錄。鏈接仍然不起作用。你能澄清實施嗎? – user1345660
如果您發現css,js,圖片鏈接被破壞,請在您的HTML頁面上嘗試' '。 –
anubhava
你只需要'DirectoryIndex home.html' – anubhava