Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just installed an SSL certificate on my site to protect a registration page that I have, but I'm trying to figure out how to get the "https" in my URL.

I have created a template in Dreamweaver with my header and footer, and a space for my body content. Each of the links on the template are relative paths: /home.html, /register.html, etc.

So how do I get the https on my registration page? Furthermore, when the form is submitted, it directs the user to register.php where the user's information is actually submitted to the database. Does https need to be used on both pages? How do I add it in this case?

share|improve this question
1  
Is the rest of your site HTTP only and the registration page is the only page that needs SSL? –  djangofan Jul 11 '12 at 21:53
    
Basically, yes. –  Jon Jul 11 '12 at 22:09
1  
You need to use an absolute link with https: for any pages that need to always be secure. You should also test on those pages whether they were requested with HTTPS and redirect if not. Finally, if you KNOW you're on a https page because of the above, relative links and relative redirects will all use https automatically. –  user6803 Jul 11 '12 at 22:27
    
Redirect to what? The secure page? –  Jon Jul 11 '12 at 22:51
1  
Yeah. If the URL of your secure page is /signup.php, you can check $_SERVER['HTTPS'] variable to see if the page was requested with https. If it isn't, redirect to https://www.yoursite.com/signup.php –  user6803 Jul 11 '12 at 23:07

1 Answer 1

up vote 2 down vote accepted

So how do I get the https on my registration page?

Assuming that you can't update all the links (which would be the prefered method) replace the existing page with one which redirects to the https url (or change the webserver config). Obviously this won't work for anything which POSTs to the URL - you'll need to switch to https earlier.

Does https need to be used on both pages?

Technically, you don't need the page with the form to be secure to ensure that the submitted data is sent over SSL - but:

1) the redirect method above won't work - the redirect is a GET operation - and you've already sent the data over http

2) as a user I'd be rather concerned about entering my details on a non-secure page

share|improve this answer
    
I created a template, so it's easy to update all links at once. –  Jon Jul 12 '12 at 15:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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