nsForum logo

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> Custom 404 Aspx Error Pages On Windows Hosting
narrowgate
post May 17 2009, 03:38 PM
Post #1





Group: Verified NS Member
Posts: 27
Joined: 26-November 08
Member No.: 3,189



I have been researching how to have my NetSol windows hosting packages point all 404 errors to a custom ASPX page. Should be easy enough, but it's not.

I was first told by a NetSol rep that I would have to switch to a unix package. Not really an option...

Next I was told by the NetSol help desk person that after he checked that IIS was setup to accept a file name (404.aspx) in the htdocs folder. This didn't work.

Obviously in a shared hosting environment we have limited (none) access to IIS, but setting up a custom error page seems very basic service, one that most hosting companies provide.

Now in the control panel it allows me to enable 404's, but they only point to a htm page. The htm doesn't allow the custom code I need to run to handle the occasional 301 when a 404 happens (just to give the reason why an aspx page is required vs. a htm page).

My ultimate questions is how can I go about having the support staff setup custom error pages for my hosting packages. I continually advocate NetSol, but this has become an increasing item of frustration. Please advise on how to proceed.

Thanks in advance for your help!

Charles Self
Narrow Gate Solutions
www.narrowgatesolutions.com
dotnetnuke.narrowgatesolutions.com - DNN Related Resources
Go to the top of the page
 
+Quote Post
Guest_Duane_*
post May 19 2009, 09:31 AM
Post #2





Guests






QUOTE (narrowgate @ May 17 2009, 04:48 PM) *
I have been researching how to have my NetSol windows hosting packages point all 404 errors to a custom ASPX page. Should be easy enough, but it's not.

I was first told by a NetSol rep that I would have to switch to a unix package. Not really an option...

Next I was told by the NetSol help desk person that after he checked that IIS was setup to accept a file name (404.aspx) in the htdocs folder. This didn't work.

Obviously in a shared hosting environment we have limited (none) access to IIS, but setting up a custom error page seems very basic service, one that most hosting companies provide.

Now in the control panel it allows me to enable 404's, but they only point to a htm page. The htm doesn't allow the custom code I need to run to handle the occasional 301 when a 404 happens (just to give the reason why an aspx page is required vs. a htm page).

My ultimate questions is how can I go about having the support staff setup custom error pages for my hosting packages. I continually advocate NetSol, but this has become an increasing item of frustration. Please advise on how to proceed.

Thanks in advance for your help!

Charles Self
Narrow Gate Solutions
www.narrowgatesolutions.com
dotnetnuke.narrowgatesolutions.com - DNN Related Resources

Currently, our custom 404 error pages (enabled within your Hosting Manager in the Site Enhancements) can only point to .htm files.

* While I understand it's not possible to do a 301 redirect with an html file, you can do a meta refresh instead.
CODE
<meta http-equiv="refresh" content="0;url=http://domain.com/errors/PageNotFound.aspx">

I do realize this isn't an option in some cases like if you are handling the header information with the aspx file, but in most circumstances, this will work very well.

* Another option is to add a 404 custom error within your web.config so that the 404 is directed to an aspx file of your choice.
CODE
<customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx">
<error statusCode="404" redirect="~/errors/PageNotFound.aspx" />
</customErrors>

The only downside here is that it will only work on aspx 404 errors. Like if they go to http://domain.com/filenotfound.aspx.
If someone navigated to http://domain.com/filenotfound.html, this web.config would not catch the 404 error.

Maybe with a mix between these two options, you can find something similar to what you're looking for?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2009 Time is now: 21st November 2009 - 11:55 PM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates