PC Review


Reply
Thread Tools Rate Thread

404 redirects not working

 
 
BobLaughland
Guest
Posts: n/a
 
      11th Mar 2008
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.
 
Reply With Quote
 
 
 
 
George Ter-Saakov
Guest
Posts: n/a
 
      11th Mar 2008
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.


"BobLaughland" <(E-Mail Removed)> wrote in message
news:47b603fb-9c6a-44d1-a7c8-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
BobLaughland
Guest
Posts: n/a
 
      11th Mar 2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirects Stan Canepa Microsoft Dot NET 4 17th Mar 2006 08:37 PM
ie redirects brasslass Windows XP Internet Explorer 1 10th Oct 2004 06:20 AM
Redirects not working... Tim Mulholland Microsoft ASP .NET 2 30th Mar 2004 01:41 PM
IE Behaving Badly - Pages with redirects, Javascript not working Doug V Windows XP Internet Explorer 5 22nd Feb 2004 06:14 PM
Wildcard redirects not working IIS 5.0 W2k adv server joe Microsoft Windows 2000 Advanced Server 1 3rd Dec 2003 10:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:26 PM.