SaaS CMS has officially launched! Learn more now.

404handler custom redirects not working

Vote:
 

Hi

I've installed the 404handler module for CMS6, but cannot get the custom redirect function to work. I've followed the instructions on the wikipage https://www.coderesort.com/p/epicode/wiki/404Handler# , but I'm not able to get it to work.

The 404 page is working as espected, but when I set up my own redirects in the 404 redirect gadget, the handler won't redirect to these pages. I'm redirected to the default 404 page instead.

I though this should be working almost out of the box. I'm not sure how to solve this problem. The system is runnning on windows 7, iis 7.5 and EPIServer CMS6.

Any suggestions?

#57162
Feb 29, 2012 11:26
Vote:
 

Hi Håvard,

Yes, it should be working out of the box. 
Have you done modifications to the standard 404 page that is included with the module? If so, make sure that it still inherits from BVNetwork.FileNotFound.NotFoundBase.

Are the url's that you try redirecting in a uncommon format? Have you tried doing a test with a couple of "simple" url's and checked if those worked?

You should aslo try logging on debug level and inspect the logs for clues. The 404 handler does quite a bit of logging, which comes in handy in situations like this :-)

 

#57163
Feb 29, 2012 12:45
Vote:
 

I'm having the same problem too, Our supplier is going to get back to us with a solution at some point.

I'll post when its working,

 

#57166
Feb 29, 2012 14:44
Vote:
 

I've not done any modifications to the standard 404 page included. The only thing I did was to move it into a directory. I've added the simplest url possible to test the redirect functionality. http://localhost:17012/aaa should redirect to an existing page (which is working 100%).

I turned on debug logging and then I got this:

2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Web.FriendlyUrlRewriteProvider.ConvertToInternalInternal - Url http://localhost:17012/aaa is not recognizeable by UrlRewrite, returning it unmodified.
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Web.UrlRewriteModule.HttpUrlRewriteToInternal - Returning URL http://localhost:17012/aaa
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Web.UrlRewriteModuleBase.BeginRequestEventHandler - Exiting with no rewrite, Url is http://localhost:17012/aaa
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Shell.Web.Routing.ModuleRouteCollection.GetRouteData - Not routing '~/aaa' since it doesn't start with '~/modules'
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Shell.Web.Routing.ModuleRouteCollection.GetRouteData - Not routing '~/aaa' since it doesn't start with '~/epiui'
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Web.UrlRewriteModuleBase.BeginRequestEventHandler - Starting request with Url http://localhost:17012/bvn/FileNotFound/404NotFound.aspx?404;http://localhost:17012/aaa
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Web.FriendlyUrlRewriteProvider.ConvertToInternalInternal - Url = http://localhost:17012/bvn/FileNotFound/404NotFound.aspx?404;http://localhost:17012/aaa
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Web.UrlRewriteModule.HttpUrlRewriteToInternal - Returning URL http://localhost:17012/bvn/FileNotFound/404NotFound.aspx?404;http://localhost:17012/aaa
2012-03-01 08:36:03,304 DEBUG [6] EPiServer.Web.UrlRewriteModuleBase.BeginRequestEventHandler - Exiting with no rewrite, Url is http://localhost:17012/bvn/FileNotFound/404NotFound.aspx?404;http://localhost:17012/aaa
2012-03-01 08:36:03,320 DEBUG [6] BVNetwork.FileNotFound.NotFoundPageUtil.HandleOnLoad - Trying to handle 404 for "/aaa" (Referrer: "")
2012-03-01 08:36:03,320 DEBUG [6] BVNetwork.FileNotFound.CustomRedirects.CustomRedirectHandler.get_Current - Begin: Get Current CustomRedirectHandler
2012-03-01 08:36:03,320 DEBUG [6] BVNetwork.FileNotFound.CustomRedirects.CustomRedirectHandler.get_Current - Returning cached handler.
2012-03-01 08:36:03,320 DEBUG [6] BVNetwork.FileNotFound.CustomRedirects.CustomRedirectHandler.get_Current - End: Get Current CustomRedirectHandler

 

#57178
Mar 01, 2012 8:43
Vote:
 

Based on the log, it seems like the redirect is not found in the cached redirect list.
Are the redirects being listed in the admin plugin (Tools -> File Not Found Handler)?

By the way, the redirect urls must be relative, not absolute.

 

#57186
Edited, Mar 01, 2012 12:09
Vote:
 

Thank you Per Magne! The problem was that I was using absolute urls... When I changed to use relative urls it worked like a charm! Hopes this post can help other people avoid doing the same stupid mistake :)

#57187
Mar 01, 2012 12:23
Vote:
 

No problem! I guess we should add a warning of a sort in there to avoid this from happening in the future.

#57188
Mar 01, 2012 12:31
Vote:
 

Some additional info:
While absolute paths are not supported in the current version, it will be supported in a future version. Then we will also add support for multiple languages, so that, for example, you can redirect base urls that ends with .no  somewhere else than base url's that end with .com.

That being said, relative urls should be used as much as possible.
 

#57189
Mar 01, 2012 13:38
Vote:
 

Paths are making no difference for me, I dont appear to have the Plugin. Could someone supply me with a screenshot of the correct setup please.

Thanks in advance,

Stefan

 



#57190
Mar 01, 2012 13:46
Vote:
 

Hi Stefan,
are you sure the plugin is not listed? It should require no configuration at all in order to get the plugin to appear in admin mode. Note that the Tools list may not be alphabetically sorted. 
Have you tried testing with a very simple url (/test for example) like Håvard did?

 

#57191
Mar 01, 2012 14:15
Vote:
 

If I do /test I get the standard IIS 404 page. I cant see it under 'Tools -> File Not Found Handler' Perhaps I'm not looking in the right place.

I have changed the path for 404 pages in IIS to /Hub-Setup/Error-Pages/404/ and still not working.

Stefan

#57192
Mar 01, 2012 14:40
Vote:
 

It should be under the Admin tab in Admin-mode in your EPiServer site.
However, I suspect that you may have a configuration problem. Are you sure your web.config settings are correct? You can check with the wiki page on epicode. 

#57261
Mar 06, 2012 9:21
Vote:
 

Will there be an update for MVC on this project?

#116977
Feb 09, 2015 13:05
Vote:
 

Yes, but I can't tell you exactly when. 

Mark Everard has made an mvc extension though

#117122
Feb 12, 2015 7:18
Vote:
 

Ok, yes I found that but it did not work as expected. I got an 301 for the aspxerror path instead and a 302 for the correct url. I also stripped a lot from that versions since most of the code could be done in the controller but that did not work either. So it is working but I get the wrong status code. And I am not sure why either. Trying to force the redirect but somehow I cant get rid of you the aspxerrorpath and the 302 code.

#117331
Feb 18, 2015 10:22
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.