How to catch all 404 errors?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 7 ans
I tried by overriding Application_OnError but that does not work.
I tried by adding Action Filter (HandleErrorAttribute) OnException but it does not fire on 404.

So what possibilities do I have to catch all 404 errors within a plugin and without modifying nopCommerce code? I want to create a URL redirect plugin.


Thanks!
Il y a 7 ans
Also tried overriding PageNotFound of CommonController, but it is not overwriteable.

Did not try overriding InvokeHttp404. This should work, but only for existing routes.

So I tried adding plugin to global.asax Application_Error()-method, but there I can not implement any plugin (or I do not see how it is done).

I want to redirect non-existing routes (URLs of old shop) to new nopCommerce URLs, but I have to lookup the IDs within the old URL and get the productname for the new url out of the database. That can not be done in IIS URL rewrite.
Il y a 7 ans
Take a look at these:
https://www.nopcommerce.com/p/2363/simple-301-redirect.aspx

https://www.nopcommerce.com/p/2312/store-301-url-extractor-plugin-by-procommerce.aspx
Il y a 7 ans
embryo wrote:

Thanks, but all those plugins have the same problem: They redirect only existing routes.

If I try to redirect http://myshop.net/products/12345/myproduct/, there is no route and there seems to be no possibility to interfere with a plugin.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.