[Classic] Customized 404 Error Page

Windows 2008 Platform

If you have signed up on February 28, 2008 or later for the Premium or Professional plan and want to customize the 404 page for the Windows portion of your hosting plan, please contact support@myhosting.com. 

In the future it should be possible to use IIS manager. At that time you will be able follow these instructions:

First, connect to your site using the IIS7 Manager tool. Once you have installed the tool on your computer, you can follow these steps to make the connection.

  1. From IIS7 Manager click File and then Connect to a Site... 
  2. Enter the following details and then click Next.
  • Server name: your domain name or your IP address
  • Site name: your domain name
  1. Enter the following details and then click Next.
  • User name: your admin ftp user name
  • Password: your admin password
  1. Choose a name for your connection and then click Finish.
  2. You will then be connected to your site.

Now you can navigate to the Error Pages section. Here you can add or remove custom error pages for various status codes including 404, and edit the path to point to the custom page for each error code.

 

Original Windows 2008 404 error page

  1. Copy code below
  2. Paste into text editor such as notepad
  3. Save file as 404.htm
  4. Upload the file to your website using FTP or FileManager to the location you indicated in IIS

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

<title>404 - File or directory not found.</title>

<style type="text/css">

<!--

body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}

fieldset{padding:0 15px 10px 15px;}

h1{font-size:2.4em;margin:0;color:#FFF;}

h2{font-size:1.7em;margin:0;color:#CC0000;}

h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}

#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;

background-color:#555555;}

#content{margin:0 0 0 2%;position:relative;}

.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}

-->

</style>

</head>

<body>

<div id="header"><h1>Server Error</h1></div>

<div id="content">

 <div class="content-container"><fieldset>

  <h2>404 - File or directory not found.</h2>

  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>

 </fieldset></div>

</div>

</body>

</html>

 

 

Windows 2003 Platform

If you signed up before February 28, 2008 and want to customize the 404 page for the Windows portion of your hosting plan, then you can activate a customized the 404 page through your Control Panel.

  1. Browse to your Control Panel at https://support.myhosting.com.
  2. Log on using your domain name and password.
  3. Click on Site Management.
  4. Click on Site Settings.
  5. Click on Customized 404 Message.

Here you can activate the custom 404 message. Before doing so please make sure you have created and uploaded a 404.asp or 404.html to the main directory of your account.

 

Original 2003 404 error page

  1. Copy the code below
  2. Paste into text editor such as notepad
  3. Save file as 404.html
  4. Upload the file to your website in the root folder as /404.html.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<HTML><HEAD><TITLE>The page cannot be found</TITLE>

<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">

<STYLE type="text/css">

  BODY { font: 8pt/12pt verdana }

  H1 { font: 13pt/15pt verdana }

  H2 { font: 8pt/12pt verdana }

  A:link { color: red }

  A:visited { color: maroon }

</STYLE>

</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

 

<h1>The page cannot be found</h1>

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

<hr>

<p>Please try the following:</p>

<ul>

<li>Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.</li>

<li>If you reached this page by clicking a link, contact

 the Web site administrator to alert them that the link is incorrectly formatted.

</li>

<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>

</ul>

<h2>HTTP Error 404 - File or directory not found.<br>Internet Information Services (IIS)</h2>

<hr>

<p>Technical Information (for support personnel)</p>

<ul>

<li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>404</b>.</li>

<li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),

 and search for topics titled <b>Web Site Setup</b>, <b>Common Administrative Tasks</b>, and <b>About Custom Error Messages</b>.</li>

</ul>

 

</TD></TR></TABLE></BODY></HTML>

 

 

Linux Platform

You can enable 404 errors through your control panel, or using an .htaccess file. Both options are included below.

  1. Control Panel steps to create customized 404 error page.
  • Browse to your Control Panel at https://support.myhosting.com.
  • Log on using your domain name and password.
  • Click on Hosting 
  • Click on Customized 404 Message 
  • Click on Enable Customized 404 
  • You'll then need to upload a 404.php file to your root folder.
  1. you can create a .htaccess file and insert the following line:
  • ErrorDocument 404 /404.html
  • Then upload a file called 404.html to the path specified in your .htaccess file.

 

Basic Custom 404 error page

  1. Copy the code below
  2. Paste into text editor such as notepad
  3. Save file as 404.php
  4. Upload the file to your website in the root folder as /404.php.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<HTML><HEAD><TITLE>The page cannot be found</TITLE>

<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">

<STYLE type="text/css">

  BODY { font: 8pt/12pt verdana }

  H1 { font: 13pt/15pt verdana }

  H2 { font: 8pt/12pt verdana }

  A:link { color: red }

  A:visited { color: maroon }

</STYLE>

</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

 

<h1>The page cannot be found</h1>

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

<hr>

<p>Please try the following:</p>

<ul>

<li>Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.</li>

<li>If you reached this page by clicking a link, contact

 the Web site administrator to alert them that the link is incorrectly formatted.

</li>

<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>

</ul>

<h2>HTTP Error 404 - File or directory not found.<br>

<hr>

 

 

</TD></TR></TABLE></BODY></HTML>

 

 

Windows 2008 404 ASP error page

  1. Copy code below
  2. Paste into text editor such as notepad
  3. Save file as 404.asp
  4. Upload the file to your website using FTP or FileManager to the location you indicated in IIS

<%@ Language=VBScript %>

<%

 

Dim myURL

myURL = Request.ServerVariables("QUERY_STRING")

 

 

if instr(myURL, "page.html") then

Response.Status="301 Moved Permanently"

Response.AddHeader "Location","

HTTP://ENTERURLHERE.COM"

else

Response.Status="301 Moved Permanently"

Response.AddHeader "Location","HTTP://ENTERURLHERE.COM"

end if

 

%>

 

 

Was this article helpful?
0 out of 0 found this helpful