Good afternoon,

This may sound like a silly question but could someone explain how to make an SSL certificate work?

I have a website that I completed (almost), and everything works just fine...

Had an SSL certificate installed yesterday, and everything looks exactly the same.

How do you make the entire website come under the SSL and not accessible via

http or just www.???

Shouldn't it be displaying the https://.....

I am apparently missing something here, and have no idea what it may be.

Thanks in advance.
Douglas

This is going to be setup in your Apache config (I believe). Not exactly sure where it is though sorry :-/

This is going to be setup in your Apache config (I believe). Not exactly sure where it is though sorry :-/

Actually, I ended up finding a very simple solution...

Since I use an included script for the page head on every page on the site, I was able to add a short PHP blurb in that, and it redirects to https for every page as it is loaded...

Here is the code, in case anybody else needs it in the future...

// If page requires SSL, and we're not in SSL mode,
// redirect to the SSL version of the page
if($_SERVER['SERVER_PORT'] != 443) {
   header("HTTP/1.1 301 Moved Permanently");
   header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
   exit();
}

I've been hassling with SSL stuff, putting it off since last October. I've been getting by with this: https://breeze.websitewelcome.com/~nichecha/subdirectory/indexfile.php?id=17
But you have to use complete URL addresses for images to make it work right.

I was going to get hosting with one of those wildcard certificates for $100.00 plus $24 for the dedicated IP plus $150 or whatever hosting you get for a year.

But then I found out the Business plan at Hostgator includes a private SSL Certificate with dedicated IP for $11.22/month so I'm trying that first. I mainly want to find out whether that includes unlimited sub-domains [www] or just the domain only.

BTW - Thanks for that code - I'm going to try it out on pages where the absolute URL isn't there. Thanks again!

You can do this with a .htaccess rule. Then there's no need to add it to every PHP page you have.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.