Welcome to TalkGraphics.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2012
    Posts
    13

    Default Graphics and fonts not showing when page not at root of site

    My site is www.holmpc.co.uk . I have a 404 page which works fine for pages at the root of the site ( for example, try www.holmpc.co.uk/fghj ).

    I also have a blog hosted on the site, at www.holmpc.co.uk/blog . Unfound pages at this level (for example try www.holmpc.co.uk/blog/fghj ) show the 404 page, but none of the font information seems to be picked up, and none of the graphics (except those hosted elsewhere on the net like the twitter button) show up.

    It seems to me as though these pictures and the font information must be held at the root of the site and referred to with relative paths. Is there a way round this?

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,504

    Default Re: Graphics and fonts not showing when page not at root of site

    Welcome to TalkGraphics

    I haven't a clue but check back frequently. I am sure one of the more savvy members will have a solution.

  3. #3
    Join Date
    Jul 2008
    Location
    Phoenix, AZ
    Posts
    267

    Default Re: Graphics and fonts not showing when page not at root of site

    When you view the source for the url:

    http://www.holmpc.co.uk/blog/fghj

    It is looking for a /blog/index_htm_files for the supporting files:

    <link rel="stylesheet" type="text/css" href="index_htm_files/xr_main.css"/> <link rel="stylesheet" type="text/css" href="index_htm_files/xr_text.css"/> <link rel="shortcut icon" href="index_htm_files/favicon.ico"/> <link rel="icon" type="image/vnd.microsoft.icon" href="index_htm_files/favicon.ico"/> <link rel="icon" type="image/png" href="index_htm_files/favicon.png"/> <script type="text/javascript" src="index_htm_files/roe.js"></script> but that directly only seems to exist in your root folderI suspect if you edit the location by just putting a forward slash in front of the links, the page will start showing as expected, like:
    <link rel="stylesheet" type="text/css" href="/index_htm_files/xr_main.css"/>
    Chris
    LotsMoreHosting.com

  4. #4
    Join Date
    Nov 2012
    Posts
    13

    Default Re: Graphics and fonts not showing when page not at root of site

    Yes, that's right. So using this method to serve a 404 page only works for attempts to view pages on the same level as the index_htm_files folder. If a user attempts to access a page in another folder (whether it exists or not) then the 404 page is not displayed correctly.

    Xara support have told me (in response to a ticket about this problem) that I need to use this method to implement my 404 page:

    > Yes, create a single 404 page and then either in your website config
    > file (on the web server - if you have access to it) change the
    > ErrorDocument 404 path, or you specify this in the .htaccess file.
    > http://www.javascriptkit.com/howto/htaccess2.shtml

    but this is exactly what i'm doing, and has the problem i've already described. What they didn't say, but I have now worked out, is that I need to put the whole url of the not found page into the .htaccess file.

    Now that the ErrorDocument 404 property in that file is http://www.holmpc.co.uk/notfound.hmtl all is working as I want it to.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •