How do I redirect to a parent directory in html

I want to know if it is possible (and how if it is) to Source to a Past Directory.

like say I have Index.html, Folder1 > page1.html inside Folder 1

Can I put a link in page1.html to reach backwards to send you to Index.html??? Im so tired of setting custom URLs to link to Index.html from the base domain...

My Project is here: Codepen.io

6

3 Answers

use relative path in your web page ex: <a href="../file_name"></a>

refer bellow site

To go up a folder:

<a href="../index.html">my link</a>
6

In the page1.html you could use relative paths:

<html>
<body>
<a href="../index.html">Go up</a>
</body>
</html>

The link references the upper level in the File System hierarchy.

Hope it helps.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like