dongxia8656 2015-06-29 07:53
浏览 44
已采纳

无法链接到一个级别的index.html

This is the structure of my messy host root folder; which I'm hoping to clean up soon;

root (folder)

.....AllWebsites (folder)

.......Website1 (folder)

index.html//please note that these html files below are not in their own folder. So they're sitting in the website1 folder loosely;

index2.html

index3.html

numerous numerous other html files

phpFolder (folder)

..........index.php (file)//this is my landing page

website2 (folder) and more folders for other websites

So I simply want a button on my index.php called "Second Landing Page" to link to index.html. So I tried writing;

<li><a href='/website1/index.html'><strong>Second Landing Page</strong></a></li>

But I get the 404 error. Then I tried writing;

href='/allWebsites/website1/index.html

 href='//website1/index.html

//I was hoping 2 slashes would bump me up one level but didn't work and many other variations without any luck. This is probably a very simple question but not for me learning as I code these sites.

One way to fix this problem would be to just place a new folder in the phpFolder called htmlFolder and paste all the html files including index.html. Then I would simply write;

<li><a href='/htmlFolder/index.html'><strong>Second Landing Page</strong></a></li>

But this will be a nightmare, so I'd appreciate any help to simply figure out how to link to the index.html where it currently resides > in the folder above phpFolder named website1 folder.

  • 写回答

1条回答 默认 最新

  • doulai8405 2015-06-29 08:08
    关注

    The term you're looking for is "relative path".

    Taken from http://www.boogiejack.com/server_paths.html

    Relative paths

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 MATLAB动图问题
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名