All those http links - they load http pages!

So try it now.

it has in .htacess
redirect permenant /index.html https://fuelmapper.com

You are redirecting https to https - try using my suggestion above ( or let me know exactly what is in your ,htaccess )

nothing is in .htacess except for the stated line of code above.

I’ll try your mod.

Thanks for the suggestion :slight_smile:

It works!
That's just bloody marvelous (thank you).

1 Like

@serverco
And it works from a google search link too (loading a page from a subdirectory).

Can this be put in my guide?
Is it a general solution for most web sites?

it’s a general method that will work on most sites - yes. It depends if there are already any commands in the .htaccess which may conflict ( generally on won’t, but it could )

Yes you can place it on your guide. Note for your guide, there are other methods you could use, which would be automatic, rather than manually needing to renew every couple of months.

1 Like

Yes, I'm aware of this issue.
However, due to some hosting sites disabling the auto renew in cPanel; more work is required to determine a coded solution.

The copy and paste method is fine for the moment.

When I have chance, I must anyway implement auto-renewal - and will add that to the guide.

For the moment, we have what we have.
This redirect method will be a much appreciated addition.
It has certainly saved me a lot of grief.

Thanks again for taking the time to help :slight_smile:

You’re Welcome :slight_smile:

There are automated methods that cpanel often still supports - see the code at https://github.com/srvrco/getssl/blob/master/other_scripts/cpanel_cert_upload for an example.

Generally I’d recommend talking to your host to enable the function in cpanel though :wink:

1 Like

Worth noting the posted solution only works with Apache httpd. It won’t work with nginx, IIS, lighttpd, etc. Apache is usually the default choice for beginners on hosted servers, though.

Here’s nginx:

server {
    listen      80;
    server_name _;
    rewrite     ^   https://$server_name$request_uri? permanent;
}

Here’s lighttpd:

$HTTP["scheme"] == "http" {
    $HTTP["host"] =~ ".*" {
        url.redirect = (".*" => "https://%0$0")
    }
}

In IIS, in SSL settings you check the box to require SSL.

The more general version of your Apache rule, which can be in htaccess, the server config, or the vhost config, is:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

If you have a very old version that doesn’t have %{HTTPS}, like 1.3, you should immediate dump that old garbage and upgrade. This is better than %{SERVER_PORT} 80 because it will capture other ports you might use (like 8080 is a popular alternative HTTP port).

1 Like

@SilverbackNet That was very thoughtful of you to provide that optional code (thank you)

I’ll include it in the guide, or link to this post :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.