How do I make links relative to the top directory instead of using ../file.html I want to normally code links can I do this?
If you want to make it relative to the top directory for any file structure the correct way to do it is to implement the backslash "/". Why would you want to do this any other way?
I want to do this because my folder structure is as follows: mainfolder 1 subfolder: file 1 2 subfolder: file 2 3 subfolder: file 3 I want to include html links from file 3 in file 1 and file 2 but since the links are ../file.html the links in file 3 don't work in both file 1 and 2. Can I fix this to make the links in file 3, file 1, and file 2 all relative to the mainfolder instead of relative to file 3 subfolder?
Wrong. Not in all cases. If your installation is located in a subdirectory of the main website, say http://www.site.com/blog/ and you want to create a relative link to http://www.site.com/blog/page.html then: 1. Using <a href="/page.html">Link</a> inside the blog will lead visitors to http://www.site.com/page.html instead of http://www.site.com/blog/page.html 2. Using <a href="page.html">Link</a> on a blog category page for instance will lead visitors to http://www.site.com/blog/category/page.html instead of http://www.site.com/blog/page.html Solution: <a href="./page.html">Link</a> should be used to create a proper link in our case.