HighDots Forums  

How to force a page to https://

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss How to force a page to https:// in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
davidbarrackphoto
 
Posts: n/a

Default How to force a page to https:// - 01-03-2008 , 05:21 AM






I have added a login on a home page but now need the home page to use SSL. Is
there a way to force the page to https:// so that the userid and password on
encrypted? I already have SSL setup and use SSL in other places on the site
but I can force the https in those cases but in this case users enter the site
directly to the home page.


Reply With Quote
  #2  
Old   
Dooza
 
Posts: n/a

Default Re: How to force a page to https:// - 01-03-2008 , 05:24 AM






davidbarrackphoto wrote:
Quote:
I have added a login on a home page but now need the home page to use SSL. Is
there a way to force the page to https:// so that the userid and password on
encrypted? I already have SSL setup and use SSL in other places on the site
but I can force the https in those cases but in this case users enter the site
directly to the home page.

What server language do you have?

If you have ASP you can use this:

<%
If Request.ServerVariables("HTTPS") = "off" Then
Response.Redirect "https://" & Request.ServerVariables("HTTP_HOST") &
Request.ServerVariables("URL") & "?" &
Request.ServerVariables("QUERY_STRING")
End If
%>


Reply With Quote
  #3  
Old   
davidbarrackphoto
 
Posts: n/a

Default Re: How to force a page to https:// - 01-03-2008 , 01:58 PM



Thanks for the reply. I am using PHP. Do you have a code example for that also? Thanks.

Reply With Quote
  #4  
Old   
Dooza
 
Posts: n/a

Default Re: How to force a page to https:// - 01-04-2008 , 03:06 AM



davidbarrackphoto wrote:
Quote:
Thanks for the reply. I am using PHP. Do you have a code example for that also? Thanks.
This is from Dave Buchholz, it was posted on the WebAssist forum:

<?php
if ($_SERVER['HTTP_HOST'] != 'site.local') // insert local hostname here
{
if (!isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'on')
{
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
}
}
?>

Steve


Reply With Quote
  #5  
Old   
pauljmartinez_sf
 
Posts: n/a

Default Re: How to force a page to https:// - 01-06-2008 , 03:43 AM



You can also do this via Apache, this was one of the http://www.htaccesselite.com/htacces...-ssl-vt61.html I found on the subject.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.