简体   繁体   English

从子文件夹访问根文件夹中的文件

[英]accessing a file in the root folder from a subfolder

my folder structure is as follows: 我的文件夹结构如下:

sample/register

i have a file in sample folder named index.html .i want to redirect to this file from a file within register folder.how can i do that? 我在sample文件夹中有一个名为index.html的文件。我想从register文件夹中的文件重定向到此文件。我该怎么做? this is what i have done.But the problem is that i have a file within register folder named index.html and its getting redirected to this folder.how do i mention the root folder? 这就是我所做的。但是问题是我在名为index.html register文件夹中有一个文件,并且该文件被重定向到该文件夹​​。我该如何提及根文件夹?

<li><a id="register" href="index.html">Back</a></li>

取决于您的根文件夹在哪里, href="/index.html"可能起作用,或者仅使用href="../index.html"在一个文件夹中向上移动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM