About 4 years ago I wrote a post about hacking PHPList to redirect the subscribe and unsubscribe pages. It is one of the most read articles on my blog. And has around 50ish comments right now. It seems like there is still a high demand for a solution.
I didn’t do much work with PHPlist since then, but from looking at the current version 2.10.13 I would assume the following works.
Please be aware that this is totally untested and just a guess. So if anyone could test this and comment here, I would appreciate it.
Code has changed a lot since I have downloaded the project the last time. There are now functions instead of spaghetti code. To be fair, there is still a lot of spaghetti code. Anyway I still think PHPList is an awesome product. Especially as an open source solution.
Seems like the structure is till the old one. All main functions are located in lists/index.php.
For the subscribe page go to line 404 and look for:
function subscribePage($id) {
This leads you to the function that is generating the subscribe page.
Looking for the line 525 there is a
return $html;
Remove that line and replace it with a
header("Location: YOURURL.com");
For the confirmation page go to line 528:
function confirmPage($id) {
Look for return $res;
in line 580.
Comment it out or remove it and replace it with the header redirect.
Finally go to line 583 for the unsubscribe page.
function unsubscribePage($id) {
You will find in line 700 the
return $res;
Same procedure here.
This is only working if PHPlist is not writting a header up front.
As I mentioned in the beginning, TOTALLY UNTESTED NO GARANTUEES.