five-server-vscode icon indicating copy to clipboard operation
five-server-vscode copied to clipboard

Href's automatically going up the folder structure on live server

Open theblueplum opened this issue 3 years ago • 3 comments

Describe the bug I have my file structure setup like pages/main/ index.html style.css ...

Although when I try to link my css using <link rel="stylesheet" href="style.css">

The live server ends up looking for the file one folder upwards

So it's looking for the style.css at page/

And throws a 404 error

This works perfectly when opening the html file itself but not on the live server. I've only changed the following settings:

  • Port
  • Ignore
  • Browser

theblueplum avatar Jun 03 '22 18:06 theblueplum

The root is different of you right-click a folder or a file. If you click "Open with Five Server (as root)", the selected folder becomes the root of the http server.

So I guess in your case, you have to right-click the "main" folder to open five server.

yandeu avatar Jun 03 '22 21:06 yandeu

VS code i type some code in Terminal .js file and I got the same problem. However, write something in .html file and hit enter seem to solve the problem

Redlips2012 avatar Feb 06 '23 20:02 Redlips2012

I have made significant changes last week.

The resolution path is different if you open /path, /path/ or /path/index.html.

yandeu avatar Feb 06 '23 20:02 yandeu