• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Custom Errors for PHP Site on Windows Based Plesk

Mr Fett

Basic Pleskian
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
 
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.
 
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:
Back
Top