I'm trying to change the path of my webpages from absolute to relative and im having trouble setting it.My server path is /username/project/webpages/homepage.html shouldn't the path be "../homepage.html"
Asked
Active
Viewed 1,656 times
0
-
It should depend of your system and stuffs, but in linux, to go up a folder, use only one dot, or the ~ sign to start from the home. When using two dots, the scope go on the top root folder structure. Try to train yourself with the ls command. As well, in pure html, you can use the base element, which will define the root path of all files in the document. – NVRM Apr 21 '17 at 19:34
-
1Possible duplicate of [Relative path in HTML](http://stackoverflow.com/questions/24028561/relative-path-in-html) – mrtig Apr 22 '17 at 02:27
1 Answers
2
It depends where the page is being called from and please note that:
- A single dot
.
means the current folder - Two dots
..
means the parent folder
In your example, you are using ..
which is incorrect if all your files are in the same folder i.e. webpages.

VirtualTroll
- 3,077
- 1
- 30
- 47