custom error pages not working on live server

497 Views Asked by At

I have a web application in which I applied URL rewriting .I have also applied custom 404 error page with web.config settings and also with global.asax. Both of them working locally,but not on live server.Is there a GoDaddy issue where site has deployed? Web.config code

 <customErrors mode="On" defaultRedirect="" >
    <error statusCode="404" redirect="~/ErrorPages/404.aspx" />
    </customErrors>

Global.asax code

Exception ex = Server.GetLastError();
        if (ex is HttpException)
        {
            if (((HttpException)(ex)).GetHttpCode() == 404)
            {

                Server.ClearError();
                Server.Transfer("~/ErrorPages/404.aspx");
            }
        }

I have also tried for following

<system.webServer>
    <httpErrorserrorMode=“Custom“ >
        <removestatusCode=“404“ subStatusCode=“-1“/>
        <errorstatusCode=“404“ path=“~/ErrorPages/404.aspx“ responseMode=“ExecuteURL“ />
    </httpErrors>
</system.webServer>

I have also tried setting custom 404 page in godaddy but no result.What will be the solution of this problem?Thanks in advance.

1

There are 1 best solutions below

0
On

Tried for setting custom 404 page in godaddy's control panel and waited for some time.Then its working for me.