Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

404 redirects not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BobLaughland - 11 Mar 2008 03:28 GMT
Hi All,

I am trying to get my website to redirect all 404 errors to the
sitemap page, but I am having trouble.

The first thing I am doing is this,

<customErrors mode="On" defaultRedirect="~/en/Sitemap1/?id=72">
     <error statusCode="404" redirect="~/en/Sitemap1/?id=72" />
</customErrors>

This works if I get the URL wrong and include an aspx extension, e.g.

http://mysite/garbagepage.aspx

But does not work if I do this,

http://mysite/garbagepage

I have tried changing the custom errors in IIS, but I am not exactly
sure what to add in there, I put /en/Sitemap1/?id=72 and that doesn't
work.

Not sure exactly how to explain this, but I am building on a CMS
system called EPiServer, so the URLs that I provide are translated
into a specific instance of a page template, so I cannot just put the
absolute path of the URL (hence the reason for the id=72 above).

Please help.
George Ter-Saakov - 11 Mar 2008 13:03 GMT
only what goes through .ASP.NET would be subject to .NET "rules"....
since http://mysite/gardbage does not have .NET extension it will not be
processed by .NET.
You need to modify your IIS default settings for 404 error.

PS: I heard in IIS 7.0 you can send all requests through .NET even those
without extension.

George.

> Hi All,
>
[quoted text clipped - 25 lines]
>
> Please help.
BobLaughland - 11 Mar 2008 20:33 GMT
Right, that makes sense.

That would suggest that my URL /en/Sitemap1/?id=72 that I added into
the IIS settings is incorrect.

The problem is that I get a 404, but that could be one of 2 things,
the original page 404 (e.g. http://mysite/garbagepage) or the
redirection to the sitemap page because it cannot find it.

I am using EPiServer (a web CMS system) so it does some fancy things
with the URLs, they don't map directly to the folders on the server
because the pages are instances of template pages.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.