Possible View in Browser bug (?)

Hello. First time posting, long time lurker.

I recently installed the “View in Browser” plugin. After running some tests, I discovered the link doesn’t work on iCloud.com or Me.com emails. It works fine on regular emails (gmail, yahoo, etc). When I click the link to view the newsletter on the browser, it redirects to the front page of my website, and not to the actual archive of the newsletter. Has anyone seen any similar occurrence? I looked around the forum but couldn’t locate anyone with a similar issue.

Thank you for the help.

@byvalenti Please can you copy a chunk of the html from the page produced by the plugin that has the problem.

Ah, sorry. it is the “view in browser” link within the campaign email that you think has a problem. Again, please show a chunk of the html of that email.

Thank you for the quick reply!

This below is the link generated on our website’s email
https://www.byvalenti.com/newsletter/lists/lt.php?tid=fUgEAQAHUlMHVhUDBlcHHVJXAAAbVgQGCktWWFMEUwEDAgNXBAVMVAQEAARQAQEdVFgBABsDUlFZSw1bUAJIDAYCCwUCVFZbAlReT1BRVgBVVVJSG1MGVgBLAF9SAEgBAQBXHgFUBFUAAQsBUVYFBg

This below is the link generated on an icloud.com email
http :// by valenti™ ORGANICS | Luxurious. Exotic. All Natural. Skincare™

The first difference I notice is the secure over the non-secure url for the icloud email. I tried on my iphone and sure enough the link on the bottom isn’t redirecting to the archive page for the newsletter, the one above however is.

@byvalenti I think that the reason it is redirected to the home page may be a problem with a redirect rule.

There is probably a rule that redirects a http URL to https but it appears to be losing part of the URL,

http://www.byvalenti.com/newsletter/lists/?m=306&p=view&pi=ViewBrowserPlugin&uid=e33dd41322b8b1b285985e905478573d&utm_source=phpList&utm_medium=email&utm_campaign=Our+NEWEST+Bakuchiol+Retinol+Serum+is+Unveiling+TODAY%21&utm_content=HTML

is redirected to

https://www.byvalenti.com/?m=306&p=view&pi=ViewBrowserPlugin&uid=e33dd41322b8b1b285985e905478573d&utm_source=phpList&utm_medium=email&utm_campaign=Our+NEWEST+Bakuchiol+Retinol+Serum+is+Unveiling+TODAY%21&utm_content=HTML

which has removed the /newsletter/lists part

I’m not sure why the URL is http instead of https in the first place. Do you remember making any changes to the way that phplist sets the scheme to http or https? I think that the default is to use whichever (http or https) your admin login session is using.

Would that be part of the plugin itself? If that’s so, I haven’t modified the plugin at all. It was installed as is.

I don’t recall making any changes to the way phplists sets the scheme to http(s) at all, but if you know where that is found I can check it out. Would that be handled by the config file by any chance?

Is this in the config file what you were referring to?

// Public protocol
// phpList will automatically use the protocol you run the admin interface on for clicktrack links and
// tracking images
// but if you want to force this to be http, when you eg run the admin on https, uncomment the below line
// see also 0016611: Click Tracking changed URL Protocol HTTPS - phpList Mantis
//define(‘PUBLIC_PROTOCOL’,‘http’);

// Admin protocol
// similar to the above, if you need to force the admin pages on either http or https (eg when behind a
// proxy that prevents proper auto-detection), you can set it here
//define(‘ADMIN_PROTOCOL’,‘https’);

If so, then I didn’t set them up, so in theory it should be using https(?)

@byvalenti Those lines are commented-out so do not have an effect.

Can you look at the phplist database? There is a linktrack_forward table. Can you see which of these rows exist in the url column

https://www.byvalenti.com/newsletter/lists/?m=306&p=view&pi=ViewBrowserPlugin

http://www.byvalenti.com/newsletter/lists/?m=306&p=view&pi=ViewBrowserPlugin

If you can delete whichever rows are there, then send your test emails again.

No the redirect rule is part of the apache web server configuration. You would need to ask your web server admin about this.

@byvalenti In config.php you can enable those lines by removing the leading ‘//’ characters and set them both to https

define('PUBLIC_PROTOCOL','https');
define('ADMIN_PROTOCOL','https');

Ok, I just made that change, so that in theory should take care of that part.

Actually both lines exist in the database. Is that supposed to happen when sending an email?

These are the two lines in the database

https… lists/?m=306&p=view&pi=ViewBrowserPlugin
http… lists/?m=306&p=view&pi=ViewBrowserPlugin

@byvalenti I think that you must have been logged in with http at some point, and again with https, so phplist created two URLs with different schemes. Setting the values in config.php should stop that from happening now.

Please delete both entries in linktrack_forward, then send some test campaigns again.

Ok. Let me try that.
Are these occurrences related to the * view in browser * not redirecting correctly or separate?

@byvalenti deleting the rows and sending again should ensure that only https is used in the URLs. That should then avoid the redirecting problem.

Actually you don’t need to delete the rows now that you have changed config.php. Just sending new test emails should confirm that the URLs are using https.

Well, this is even worse, now I get is “Not allowed to view message 307” when clicking the view in browser link.

@byvalenti That is to ensure that only people who belong to the selected lists for the campaign can view it in this way.

When composing the campaign you need to select the lists on the Lists tab and save the campaign. Then try clicking the link, it should then work. No need to send another test email.

Thank you. I did not know that. Time to style that error message page a bit then.

Thanks for all the help. I truly appreciate it.