Relative Paths not working on apache2 web server

Good evening!

I'm pretty new to Linux and Apache and I have a problem with relative paths. I developed my website locally on a Mac, using relative paths and everything worked fine. My files are in a folder with following subfolders:

  • sites
  • css
  • images
  • Now I'm trying to set up my website on a Linux server running Debian. Almost everything worked out perfectly and I can reach my index.html through the internet. But obviously, relative paths are not working, since I placed my images, my css-file and my other sites in above subfolders, which I try to access with relative paths, but actually they are not working. When I try to access another site (about.html) which is in the sites-folder, I just get this error:

    404 Not Found The requested URL /sites/about.html was not found on this server.

    For example, from my index.html, I'm trying to access my css-file with this path:

    ../css/standard.css
    

    I've also implemented external paths, these are working correctly. I'd really appreciate any help or clues. Thank you very much!


    i think the mistake is in the path:

    If index.html is in folder where folders "sites, css, etc" are stored, you have to use

    css/standard.css
    

    instead of

    ../css/standard.css
    
    链接地址: http://www.djcxy.com/p/34858.html

    上一篇: 解析推送JSON IOS webview

    下一篇: 相对路径不能在apache2 web服务器上工作