Problem with permalink dispatcher and enewsletters

By JeffC - July 11, 2018

Hi

I have a new problem, which I think has been caused by moving from http to https.

The links in my emails sent via Newsletter Builder no longer work. On clicking the following message is displayed:

Not Found. The requested URL /cmsAdmin/plugins/permalinks_dispatcher.php was not found on this server.

I'm guessing somewhere in my newsletterBuilder files I need to change http to https, can someone tell me where?

Thanks
Jeff

Jeff

By JeffC - July 30, 2018

Hi Greg

Thanks for your reply.

Yep, you're spot on. The full message is:

Not Found

The requested URL /cmsAdmin/plugins/permalinks_dispatcher.php was not found on this server.


Permalinks Dispatcher at mydomainhere.co.uk Port 443

I don't know how to test if switching between HTTPS and HTTP makes a difference. The error is occurring with an automated email you set up for me a few years ago. I am running a cron job to automatically send an email each Monday at 0:00. For now I have made the emails inactive, the only way I know of testing it is to make active and keep my fingers crossed! There's 10,000+ people on my list – so I would rather not risk that, if it could be avoided.  

I'm using v3.10 and v1.05

Here is the content of my htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^permalinks_dispatcher\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cmsAdmin/plugins/permalinks_dispatcher.php [L]
</IfModule>

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 46.37.162.38/31
deny from 46.37.162.40/29

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-ea-php56___lsphp .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

Jeff

By gregThomas - July 30, 2018

Hey Jeff, 

Thanks for the extra details, I've got a good idea of what's causing the problem.

On some hosting packages the global variable that we use to get the URL contains the path to the current file ( /cmsAdmin/plugins/permalinks_dispatcher.php ) instead of the URL that the browser is attempting to access (/my/permalink).

To resolve this, If you open the file permalinks.php plugin file, then edit line 313 from this:

  if     (@$_SERVER['REQUEST_URI'])        { $redirectUrl = $_SERVER['REQUEST_URI']; }
  elseif (@$_SERVER['REDIRECT_URL'])       { $redirectUrl = $_SERVER['REDIRECT_URL']; }
  elseif (@$_SERVER['SCRIPT_URL'])         { $redirectUrl = $_SERVER['SCRIPT_URL']; }
  elseif (@$_SERVER['HTTP_X_REWRITE_URL']) { $redirectUrl = $_SERVER['HTTP_X_REWRITE_URL']; }  // For Windows/IIS Servers with ISAPI_Rewrite

to this:

  if     (@$_SERVER['SCRIPT_URL'])         { $redirectUrl = $_SERVER['REQUEST_URI']; }
  elseif (@$_SERVER['REDIRECT_URL'])       { $redirectUrl = $_SERVER['REDIRECT_URL']; }
  elseif (@$_SERVER['REQUEST_URI'])        { $redirectUrl = $_SERVER['SCRIPT_URL']; }
  elseif (@$_SERVER['HTTP_X_REWRITE_URL']) { $redirectUrl = $_SERVER['HTTP_X_REWRITE_URL']; }  // For Windows/IIS Servers with ISAPI_Rewrite

That should resolve the issue, as the SCRIPT_URL variable is normally accurate.

Thanks,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By JeffC - August 2, 2018 - edited: August 2, 2018

Thanks Greg

I have made those changes. What's the best way of checking that it has worked, without actually sending a email to my database?

Something is still not right however, and the problem is wider than I thought. The problem is not just with email, the link below should redirect to the https, but I am getting the same dispatcher error.

http://www.mydomainhere.couk/recipe/bruschetta-3-ways/

Can I escalate this to higher tier support? Happy to pay to fix, so that we can get it sorted asap.

Jeff

By gregThomas - August 2, 2018

Hey Jeff,

Sure thing, we can take a look into this for you. If you send an email to support@interactivetools.com and include a the CMS and FTP details for the site and I'll get started.

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By JeffC - August 3, 2018

Thanks Greg.

I sent you an email yesterday via the form on the website. I think that goes to consulting@. Will resend to support@. Apologies if you receive it twice.

Cheers

Jeff