Redirect user after a 404 Error

Ajie

Member
It's possible to redirect a user when he click a link that expire (unsubscribe, list delete, )etc instead to see
Error 404!
The requested page does not exist?

Sometimes I need to reinstall mailwizz and old campaign sent have broken link.
 
Yes, that's what I mean, how if the list isn't valid anymore?
Then there's nothing we can do right now.
I needed all of the broken link sent from old installed mailwizz to be redirected to a new link.
We have a hook for this which you can use, by creating a file called init-custom.php in /apps/ folder with following contents:
PHP:
<?php

Yii::app()->hooks->addAction('frontend_campaigns_track_url_item_not_found', function(){
    Yii::app()->request->redirect('https://www.google.com/');
});
Doing like the above will do what you are after. I'll be thinking if we should add this in the core, at the moment i don't think so.
 
Then there's nothing we can do right now.

We have a hook for this which you can use, by creating a file called init-custom.php in /apps/ folder with following contents:
PHP:
<?php

Yii::app()->hooks->addAction('frontend_campaigns_track_url_item_not_found', function(){
    Yii::app()->request->redirect('https://www.google.com/');
});
Doing like the above will do what you are after. I'll be thinking if we should add this in the core, at the moment i don't think so.
Hi, could you please elaborate on how to install this hook?
I created init-custom.php in /apps/ folder with that code, but seems like nothing changed.
 
Back
Top