#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    136
    Rep Power
    14

    Question "Looks simple" : altering the "page can not be displayed" ms


    Hi

    We have two websites:
    1. On Internet
    2. On INTRANET
    Anyone with any internet account can access to the first site, but to enter to the 2nd, u need to have a special internet account (say, a certain supplier).

    The general menu is on the Internet website, but one of the items in the sub-menu, links to a page On the INTRANET. If u r not authorized (=did not use the certain internet account), then u get the page "The page can not be displayed".

    I'd like to replace this page with a "help" page that I will create (Btw - Better that the help page will be located on the general website).
    How do I redirect the "page can not be displayed" to the help page, and of course, redirect it ONLY when the "page can not be displayed" page is there b/c of linking from this sub-menu, or b/c of trying to reach directly to the Intranet certain URL that this sub menu links to.

    Thanks,
    Avivit
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    I'm only guessing here, but this is how I would go about it.

    I'll make the assumption that your running IIS5 on windows NT/2000

    In that case go to the website in your internet information services panel from start->Administrative tools
    right click on the website name and select properties.
    Then select the tab for custom errors. Then select the error number you wish to change your nice help page to. (when you get the error look for a 4xx or 5xx number thats the page you will need to replace) I'm pretty sure you can place almost any url there so just make your help page an asp page.

    From there, in the help.asp use Request.ServerVariabels("HTTP_REFERER") to determine if the page came from your site1 if not redirect to old error page and nobody will be the wiser (except for those who need to know)
    Last edited by ngibsonau; March 5th, 2003 at 07:37 AM.
    --

    ngibsonau
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    136
    Rep Power
    14

    Btw - I have checked again and the error msg is:


    Btw - I have checked again and the error msg is:

    Gateway Timeout
    The following error occurred:
    Server unreachable


    --------------------------------------------------------------------------------
    Please contact the administrator.


    (And not "page can be displayed". Sorry)

    is it in the same custom error place u mentioned?
    Do u know the error number?



    Thanks. Your solution look god. I'll check it out
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    The error you want to catch is error 504. There is no default error page for that on my IIS

    I don't know if you can just make a file named

    C:\WINNT\Help\Common\504.htm

    It may or may not need a little more work to find out how to catch the 504 error. But in principle it should work the same. It is a server error so maybe it comes from a different server from yours?

    You should be able to track it down though.
    --

    ngibsonau
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    NJ, USA
    Posts
    11
    Rep Power
    0
    I'm also guessing too, but you may be able to offer a coding solution.

    Assuming you have either an IP, or a cookie (server variable) that you can use to identify a particular user, you can dynamically modify the link based on the status of the variable/IP.

    Psuedo code
    if user=(ok for intranet) then
    make internal link
    else
    make link to help screen
    End if


    Ray

IMN logo majestic logo threadwatch logo seochat tools logo