Webconfig customerror
-
Hi Guys, I using the followiing code in my Web.config file <customErrors mode="RemoteOnly" defaultRedirect="default.aspx"> <error statusCode="404" redirect="default.aspx"/> </customErrors> My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page. It shows the error page of the Browser. HTTP Error 404 -File or directory not found. I want to redirect it to my default page. If anybody has suggestions or coding .Please reply. Thanks Jith -- modified at 3:04 Friday 18th May, 2007
-
Hi Guys, I using the followiing code in my Web.config file <customErrors mode="RemoteOnly" defaultRedirect="default.aspx"> <error statusCode="404" redirect="default.aspx"/> </customErrors> My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page. It shows the error page of the Browser. HTTP Error 404 -File or directory not found. I want to redirect it to my default page. If anybody has suggestions or coding .Please reply. Thanks Jith -- modified at 3:04 Friday 18th May, 2007
jithbiz0033 wrote:
My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page.
because For instance, if you define a custom error for the status code 404, ASP.NET will issue it anytime you refer to a non-existing .aspx page The custom errors are only issued for those elements handled by ASP.NET. For instance, if you refer to a non-existing .htm page, IIS issues the standard 404 error Taken from MSDN
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Hi Guys, I using the followiing code in my Web.config file <customErrors mode="RemoteOnly" defaultRedirect="default.aspx"> <error statusCode="404" redirect="default.aspx"/> </customErrors> My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page. It shows the error page of the Browser. HTTP Error 404 -File or directory not found. I want to redirect it to my default page. If anybody has suggestions or coding .Please reply. Thanks Jith -- modified at 3:04 Friday 18th May, 2007
jithbiz0033 wrote:
mode="RemoteOnly
try with mode="On" Might be you are trying at the local host.
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Hi Guys, I using the followiing code in my Web.config file <customErrors mode="RemoteOnly" defaultRedirect="default.aspx"> <error statusCode="404" redirect="default.aspx"/> </customErrors> My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page. It shows the error page of the Browser. HTTP Error 404 -File or directory not found. I want to redirect it to my default page. If anybody has suggestions or coding .Please reply. Thanks Jith -- modified at 3:04 Friday 18th May, 2007
jithbiz0033 wrote:
My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page.
This is Because web.config is not having any role in serving HTML or PHP pages. Webserver will be doing this job. Web.Config will be working only with the extensions mapped with aspnet_isapi.dll. You can redirect HTML or PHP file by changing the default 404 error message in IIS.
Navaneeth My Website
-
jithbiz0033 wrote:
My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page.
because For instance, if you define a custom error for the status code 404, ASP.NET will issue it anytime you refer to a non-existing .aspx page The custom errors are only issued for those elements handled by ASP.NET. For instance, if you refer to a non-existing .htm page, IIS issues the standard 404 error Taken from MSDN
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
Hi, Is there any way that I could redirect the other extensions to my default page? Thanks, Jith
-
jithbiz0033 wrote:
My problem is if give an file name with extensions(like .htm,.php,.asp etc) other than .aspx the page is not redirecting to the default page.
This is Because web.config is not having any role in serving HTML or PHP pages. Webserver will be doing this job. Web.Config will be working only with the extensions mapped with aspnet_isapi.dll. You can redirect HTML or PHP file by changing the default 404 error message in IIS.
Navaneeth My Website
Hi, How can I redirect other extensions files ? to my default page Thanks Jith