1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

404 error page inside folder

Discussion in 'Programming' started by seo_expert, Jan 17, 2006.

  1. #1
    I have written code for 404 error (404.htm) and it works fine untill you are in folder pages.

    for instance it works fine with www mydomain . com but not in www mydomain . com /folder/filename

    The format of the pages changes in that the images do not show up and the CSS doesn't work.

    Let me know when I need to do to make the 404.htm page look same no matter where I'm on my site.
     
    seo_expert, Jan 17, 2006 IP
  2. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    maybe you need to use root reletive links in your html
    eg
    not
    <img src="../../images/somepic.gif">
    use
    <img src="/images/somepic.gif">
     
    stuw, Jan 17, 2006 IP
  3. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Add the following to the head of the page.
    <Base href="http://www.yoursite.co.uk">
     
    dave487, Jan 17, 2006 IP
  4. seo_expert

    seo_expert Well-Known Member

    Messages:
    475
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    123
    #4
    Do I need to add this line in the head of the 404.htm page?...

    Thanks
     
    seo_expert, Jan 18, 2006 IP
  5. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Not if all your links to images and the css are root relative.
     
    stuw, Jan 18, 2006 IP
  6. seo_expert

    seo_expert Well-Known Member

    Messages:
    475
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    123
    #6
    thanks for the good help...
     
    seo_expert, Jan 19, 2006 IP
  7. tccoder

    tccoder Peon

    Messages:
    69
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    <Base href="http://www.yoursite.co.uk"> on the 404.htm page should fix it
     
    tccoder, Jan 28, 2006 IP
  8. seo_expert

    seo_expert Well-Known Member

    Messages:
    475
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    123
    #8
    yes I got the problem fixed by adding <Base href="http://www.yoursite.co.uk"> in my 404.htm file. :)
     
    seo_expert, Jan 29, 2006 IP