在我.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