1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Custom Errors for PHP Site on Windows Based Plesk

Discussion in 'Plesk 11.x for Windows' started by Mr Fett, Feb 5, 2013.

  1. Mr Fett

    Mr Fett Basic Pleskian

    14
    35%
    Joined:
    Dec 12, 2012
    Messages:
    86
    Likes Received:
    1
    Hi all,

    I'm running Plesk 11 on Server 2008 R2 and have my first PHP website being hosted and I can't work out how to setup custom errors (for ASP / ASP.NET websites I simply use web.config).

    I've enabled custom errors in the control panel, disabled all scripting types except for PHP and CGI support and tried setting up a custom error page via the control panel but I just keep getting an error saying "Error: File location is invalid."

    Anyone have any suggestions?

    Bob
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
  3. knowntobe

    knowntobe New Pleskian

    10
    35%
    Joined:
    Jan 2, 2013
    Messages:
    8
    Likes Received:
    0
  4. knowntobe

    knowntobe New Pleskian

    10
    35%
    Joined:
    Jan 2, 2013
    Messages:
    8
    Likes Received:
    0
  5. knowntobe

    knowntobe New Pleskian

    10
    35%
    Joined:
    Jan 2, 2013
    Messages:
    8
    Likes Received:
    0
    Still stuck with this. The article linked by plesk support says :
    In Plesk Control Panel, create a virtual directory for custom error document files: Domains, domain.name, Web Directories, AddNewVirtualDirectory (This directory will be created on the server in %plesk_vhosts%\domain.name\httpdocs\.)
    plesk 11s file structure is httpdocs/domain.name/
    I tried adding a new virtual directory and its placed inside domain.name, so we have httpdocs/domain.name/virtualdiretory.

    Then we have :

    The error needs to be specified in the following manner:
    Type: URI
    Location: /Created_Virtual_Directory/file.name

    so I put in /customerrors/404.asp
    and get - Error: Wrong URL format. Please enter an absolute URL within the virtual host (site).
    with no sample of what the format should look like. Im guessing the real url, against the support doc. I put that in, it accepts it but iis still shows the standard 404. It doesnt change the iis settings no matter what I put in.
    I tried the file option, that didnt work either

    So can I please get a 100% sure fire way to setup a custom 404.asp error message, one that allows me to use my code to track the previous page, do some magic, then display the error. Its kind of important and Im quite surprised this is ignored, from a developer who is paid, monthly, for their product.
     
  6. knowntobe

    knowntobe New Pleskian

    10
    35%
    Joined:
    Jan 2, 2013
    Messages:
    8
    Likes Received:
    0
    Additional note, which might be causing some issues....
    The plesk 11 migration agent has placed some domains inside :
    C:\inetpub\vhosts\largesites.package\httpdocs\domain.com
    instead of the default :
    C:\inetpub\vhosts\domain.com\httpdocs
    stupidly its even created a site in iis called "largesites.package". This is likely where the issues Im having

    however, Im still unable to use a URL no matter what format I try, except the full url. Im wondering if there should be something set in the ApplicationHost.Config, anyone? currently I have :
    <httpErrors errorMode="Custom" allowAbsolutePathsWhenDelegated="true">

    if I set it as file, and ONLY put in file.ext I can get it to load a static file from the error_docs folder
    If I set as file and put in a path, relative path, it errors
    If I put in a relative url, it errors
    I need it to be able to load a .asp page, without a 301 redirect
     
    Last edited: Apr 9, 2013
Loading...