For me this is invalid URL, so i except this to redirect to 404 page which I have configured in IIS, if the page not found Instead.. this page is loading default.aspx without CSS, Scripts, and UserControls.
Could someone help, how to identify this kind of invalid URL and redirect to 404?
dfordurai
Member
12 Points
6 Posts
Re: Checking if a URL Exists and redirect to 404
Aug 24, 2010 02:30 AM|LINK
Is that possible to check, if the URL exist in the website?
If the URL is invalid then redirect to 404 .
For Example:
Valid URL is http://localhost/ABC/default.aspx
Output will be the default.aspx webpage, that’s fine.
Note: this default.aspx page includes come Scripts, CSS, and UserControl – all works fine.
Invalid URL is http://localhost/ABC/default.aspx/images/default.aspx
For me this is invalid URL, so i except this to redirect to 404 page which I have configured in IIS, if the page not found Instead.. this page is loading default.aspx without CSS, Scripts, and UserControls.
Could someone help, how to identify this kind of invalid URL and redirect to 404?
FYR – Folder Structure
C:\inetpub\wwwroot\ABC\
\CSS\
\Scripts\
\UserControls\
\Images\
\Default.aspx
\Default.aspx.cs
Thanks in Advance,