0

{{ entry.url }} is generating a https:// link. I don't have SSL on this site, so the page errors out.

Settings > General > Site Url is "http://..."

My .htaccess is below (though I've read the redirect doesn't work on shared hosting).

    RewriteEngine On
    RewriteBase /
    RewriteCond %{SERVER_PORT} 443
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Aside from "Get an SSL certificate," any suggestions on a fix?

6
  • Are you setting siteUrl dynamically in public index.php or config/general.php? Can you share them? Do you have any plugins installed that interfere with siteUrl or link creation? – Brad Bell Sep 29 '17 at 0:31
  • In config/general.php siteUrl is null... I have two plugins: contactform and simplemap. I don't think either of those would interfere. – Jeff Fulton Sep 29 '17 at 0:56
  • I got the link to work, but it seems like a dumb workaround. For some reason, http://example.com redirects to https://example.com when I use {{ entry.Url }}, but when I use http://www. the redirect doesn't occur. I changed my Site Url to www. and created a redirect to www. in the .htaccess file. – Jeff Fulton Sep 29 '17 at 2:22
  • I think the problem may be with HSTS, but I don't know enough about it to know if I'm right or not... also, it was only redirecting like this on mobile. Super weird. – Jeff Fulton Sep 29 '17 at 2:26
  • HSTS is a Chrome only thing and you have to specifically register that domain with Google saying you want to opp-in to HSTS. Is that something you did? – Brad Bell Sep 29 '17 at 3:16
1

I got the link to work, but it seems like a dumb workaround. For some reason, http://example.com redirects to https://example.com when I use {{ entry.Url }}, but when I use http://www. the redirect doesn't occur. I changed my Site Url to www. and created a redirect to www. in the .htaccess file.

1

You could try and add the following condition to the .htaccess which should redirect everything to http, perhaps it'll work:

RewriteCond %{HTTPS} off

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.