Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    404 error page won't show include files...

    My web host has designated 404.asp as the default 404 error page. This page has a couple of includes like this:

    <!--#include file="includes/navigation.inc"-->

    ...however they are not displaying. If you view the source, you can see that it isn't parsing. Any idea why?

    Ash

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Have you tried using an absolute path to the include file? This would mean putting a forward slash before the directory name so that whichever directory the page is in that pulled the 404 error will look to the root directory then to the includes directory for the file navigation.inc
    something like this

    <!--#include file="/includes/navigation.inc"-->

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope, that doesn't work. I've also tried the full url.

    I wonder if having the .asp extention is screwing things up?

  • #4
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    No. The file extension shouldnt matter. Try putting the code below into the 404.asp page and then navigate to a page that doesn't exist. try navigating to a few different nonexistant pages in different directories. You can then see if it is changing the path

    Response.Write Request.ServerVariables("PATH_INFO")


    PS the include file is placed outside of the asp delimiters correct?

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi and thank for helping!

    I've placed this <% Response.Write Request.ServerVariables("PATH_INFO") %> into 404.asp and it is not parsing. When you view the source of the page, you actually see <% Response.Write Request.ServerVariables("PATH_INFO") %>

    I don't understand why other asp pages/scripts will run fine...maybe that's why I assumed it was a setting in IIS perhaps?

  • #6
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    that tells me the page is running as an .htm/html page and not an .asp page perhaps it was originally 404.htm and then was saved as 404.asp but instead of saving it with the proper extension it saved it as 404.asp.htm try deleting the page from the server and replace it with a page with the proper extension

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is just WIERD! I removed 404.asp from the server AND made certain there wasn't a page entitled 404.htm or 404.html...there wasn't (not even with a hidden attribute).

    I then uploaded 404.asp and same thing...asp code or includes refuse to parse. If you think I've reached an impasse from this side, what should I ask the host?

  • #8
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    It sounds like the hosting company has some setting that is treating the 404 page like it is an .htm and not an asp page. Definately something you need to speak to them about.

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll do that, thanks for all the help!


  •  

    Posting Permissions

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