I host several sites on my unlimited plesk (windows) hosting account (each domain points to a subsite).
I need to create 404, 403, 500 error pages for each site. I know I cannot use a separate web.config (?or .htaccess?) file for each subsite but cannot find documentation for creating a single web.config file and the general layout.
Examples would be:
abc.com points to abc.myplesksite.com
404 error redirects to abc.com/404.asp
def.com points to def.myplesksite.com
404 error redirects to def.com/404.html
I can follow documentation but cannot find a source. This is ASP.NET 4.5.2
How to create custom error pages? has instructions for creating custom error pages for each domain.
Set up a custom 404 page This article is specific to Godaddy. Error docs placed in the main Virtual Directory apply to all websites. you will need to place the error docs under the virtual directory for each domain that needs custom error docs.
You can also use web.config to setup custom error docs. Setting Up Custom Error Documents With Plesk on Windows since that article is specific to Hostgator you can use option 3 as a guide for creating the web.config file.
<?xml version="1.0"?> <configuration> <system.web> <customErrors mode="On"/> </system.web> <system.webServer> <httpErrors errorMode="Custom"> <remove statusCode=”404” subStatusCode=”-1”/> <error statusCode=”404”path=”/error_docs/NothingHere.html” responseMode=”ExecuteURL”/> </httpErrors> </system.webServer> </configuration>
Solid info from @oslinux. I also wanted to point out that within a Plesk (Windows) environment, you actually can use multiple web.config files per directory. However, if you do this you need to ensure coding for your control files do not cause internal conflicts with each other that tend to result in 500 Internal Server Errors.
Perhaps another member who's accomplished this sort of setup within their own Windows hosting plan could offer more insight or tips to keep in mind when setting up multiple 404 pages for multiple sites within a single shared account?