SOLVED Email Confirmation Link Redirects to 404 Page


  • Hi!
    I've noticed that after moving to another server and updating to 1.17.0 the links in emails sent from forum became broken.
    The forum is located at https://forum.c4d.space domain. And for emails I use http://mail.c4d.space domain. When new user registers at the forum he must confirm his email by clicking the link in email. And the beginning of the link looks like this: http://mail.c4d.space/ls/click?upn=Ha4sgyd1ZSq....... — which is the page that doesn't exist.

    I don't know what I did wrong and why it stopped working at the new server. Maybe something wrong with DNS records?

    Thank you in advance for the help.

    UPDATE 1:
    All URLs from any emails delivered from forum redirect to http://mail.c4d.space/ls/click?upn=long-hash.
    And even when I manually rewrite link as https://forum.c4d.space/ls/click?upn=long-hash it still brings me to the 404 page:

    3c9667b3-00c8-4cb7-b241-a79efc041094-image.png

    UPDATE 2:
    Upgrading forum from 1.17.0 to 1.17.1 didn't help either.


  • I've found what was the problem: in my SendGrid account there was Link Branding enabled. But that's little bit strange because it was enabled before moving to the new server and it worked fine.

    b2e508e4-4bbf-4212-aee6-02b14cea34b5-image.png

  • Global Moderator Plugin & Theme Dev

    @aleksei what's the url in your config.json?


  • @pitaj it's "https://forum.c4d.space"

    I also tried to take the link from email and manually replace mail. with forum. So that the URL looked like this: https://forum.c4d.space/ls/click?upn=Ha4sgyd1ZSq....... but it also didn't help — I've got 404 error.

    And is this link in email generated by NodeBB or SendGrid? (using SendGrid plugin)

  • Global Moderator Plugin & Theme Dev

    @aleksei it sounds like something in your email chain is replacing the links. When you click on the link does it try to redirect you somewhere else?


  • @pitaj no it doesn't. Or I can't notice that.
    And one more thing: I've just noticed that all URLs in any emails sent from forum link to the http://mail.c4d.space/.
    I've updated the SendGrid API key and virified my domains (CNAMEs in DNS) once again, but it didn't help.

    Maybe the problem is somewhere in the Nginx redirects?
    When you visit this link http://mail.c4d.space/ you will see the default Nginx welcome page. I don't know whether it is normal or not. Also the default block in the /etc/nginx/sites-available looks like this:

    server {
    	
    	listen 80 default_server;
    	listen [::]:80 default_server;
    
    	root /var/www/html;
    
    	index index.html index.htm index.nginx-debian.html;
    
    	server_name _;
    
    	location / {
    		try_files $uri $uri/ =404;
    	}
    
    }
    

    But most probably the problem is hidden somewhere on the stage of email template compilation (or link generation) before sending. But I don't know where and how to fix this...

  • Global Moderator Plugin & Theme Dev

    The forum is located at https://forum.c4d.space domain. And for emails I use http://mail.c4d.space domain.

    I'm confused as to where the mail subdomain comes into it. Is this a self hosted sendgrid at the mail subdomain?


  • I've found what was the problem: in my SendGrid account there was Link Branding enabled. But that's little bit strange because it was enabled before moving to the new server and it worked fine.

    b2e508e4-4bbf-4212-aee6-02b14cea34b5-image.png

Suggested Topics

| |