Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Apache and SSL, basic question

I am building a website using PHP and its going to live on an Apache server. There are certain parts of the site that are just content, they don't need to be secure but there are a few pages like the login and settings pages that I'd like to be secure. I've heard about SSL and I was wondering. How does it work? Do I need to add special code to my PHP code or is it something that I just do on the server.

For example, say my source file is login.php, how do I just tell Apache to use SSL on that? Sorry if this is a pretty basic and newbie question but I am lost when it comes to this sort of stuff.
0
Linky
Asked:
Linky
  • 3
  • 3
1 Solution
 
periwinkleCommented:
Assuming that you have SSL set up on your server, with a certificate, etc., to access via SSL is simply a matter of changing the url from:

http://www.yourdomain.com/login.php

to

https://www.yourdomain.com/login.php

(i.e. from http:// protocol to https:// protocol).
0
 
LinkyAuthor Commented:
then what is stopping people from just typing http instead of https
0
 
periwinkleCommented:
Nothing, unless you code preventatively!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LinkyAuthor Commented:
And how can that be done, so that even if they type http://whatever it will use SSL anyway. I'm using PHP but I doubt that matters since this is mainly dealing with the server.
0
 
periwinkleCommented:
It won't - unless you redirect the http:// request to a https:// request.  But from what you have said, you're only having a few pages that are ssl - if you LINK to them as https:// then they'll be secure!
0
 
LinkyAuthor Commented:
Sounds good, thanks for the help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now