469,304 Members | 2,192 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

Force HTTPS

Is there a way to use HTTPS only on certain pages? I have two pages that I
want to use my SSL Cert, but the rest of the files I do not... they are all
in the same folder, and I can not move them.
Jul 19 '05 #1
7 12175
Actually, you can do this with ASP...

http://support.microsoft.com/support.../Q239/8/75.asp

"Andrew Durstewitz" <ad******@devbuilder.org> wrote in message
news:3f*********************@news.frii.net...
You need to do this in IIS not ASP. I would ask this question in an IIS
newsgroup.

-Andrew

* * * Sent via DevBuilder http://www.devbuilder.org * * *
Developer Resources for High End Developers.

Jul 19 '05 #2
You could add something like this to the top of your pages:

<%

If UCase(Request.ServerVariables("HTTPS")) = "OFF" Then
'''get page
sRedirect = "https://" & Request.ServerVariables("SERVER_NAME") &
Request.ServerVariables("PATH_INFO") & "?" & Request.Querystring
Response.Redirect sRedirect
End If

%>

Ray at work

"John McDermidt" <jmcdt73_at_msn.com> wrote in message
news:OY**************@tk2msftngp13.phx.gbl...
Is there a way to use HTTPS only on certain pages? I have two pages that I
want to use my SSL Cert, but the rest of the files I do not... they are all in the same folder, and I can not move them.

Jul 19 '05 #3
Neat. I never knew you could do it with ASP. I just allways did it
with the server configuration.

-Andrew

* * * Sent via DevBuilder http://www.devbuilder.org * * *
Developer Resources for High End Developers.
Jul 19 '05 #4
Individual items have a security tab as well. Right click the page inside
the IIS snap in & go to properties. Click the security tab, edit the cert,
and check off the only allow ssl connections. The individual settings
override the global ones.

HTH

DP
"John McDermidt" <jmcdt73_at_msn.com> wrote in message
news:OY**************@tk2msftngp13.phx.gbl...
Is there a way to use HTTPS only on certain pages? I have two pages that I
want to use my SSL Cert, but the rest of the files I do not... they are all in the same folder, and I can not move them.

Jul 19 '05 #5
On Thu, 3 Jul 2003 09:44:34 -0400, "John McDermidt"
<jmcdt73_at_msn.com> wrote:
Is there a way to use HTTPS only on certain pages? I have two pages that I
want to use my SSL Cert, but the rest of the files I do not... they are all
in the same folder, and I can not move them.
Yes, set the entire folder to SSL and just use https on the two pages.
Or, just set each page to SSL in the MMC. If you are on a shared
hosting environment have your hosting company do this for you.

John Cesta

http://www.cybersmarts.net
-------------------------------------------
ColdFusion Hosting Includes 10 Domains
100% Browser Based Administration
---------------------------------
LogFileManager - The only IIS Logfile Management Tool
DomainReportIt PRO - Helps Convert IIS Installs
http://www.serverautomationtools.com


Jul 19 '05 #6
I didn't know you could do it via individual page properties. The method I
use is:

<%
dim myname
dim i

myname = Request.ServerVariables("SCRIPT_NAME")
i = instr(myname, ">")
if i > 0 then myname = left(myname, i-1)
do while left(myname,1) = "/"
myname = mid(myname, 2)
loop

if ucase(Request.ServerVariables("HTTPS")) = "OFF" then
response.redirect https://<siteurl>/ & myname
end if
%>

The <siteurl> is the base of the current page.

By putting this code before any HTML code on the ASP page, the ASP page will
only show with SSL. If the user cancels the certificate or security switch,
the previous page will remain the current page.

Mike Ober.

"Splatter" <me@me.net> wrote in message
news:nK****************@news.uswest.net...
Individual items have a security tab as well. Right click the page inside
the IIS snap in & go to properties. Click the security tab, edit the cert,
and check off the only allow ssl connections. The individual settings
override the global ones.

HTH

DP
"John McDermidt" <jmcdt73_at_msn.com> wrote in message
news:OY**************@tk2msftngp13.phx.gbl...
Is there a way to use HTTPS only on certain pages? I have two pages that I want to use my SSL Cert, but the rest of the files I do not... they are

all
in the same folder, and I can not move them.


Jul 19 '05 #7

"Michael D. Ober" <obermd-@-alum-mit-edu-nospam> wrote in message
news:b4****************@news.uswest.net...
I didn't know you could do it via individual page properties. The method I use is:
"Splatter" <me@me.net> wrote in message
news:nK****************@news.uswest.net...
Individual items have a security tab as well. Right click the page inside the IIS snap in & go to properties. Click the security tab, edit the cert, and check off the only allow ssl connections. The individual settings
override the global ones

By putting this code before any HTML code on the ASP page, the ASP page will only show with SSL. If the user cancels the certificate or security switch, the previous page will remain the current page.

Mike Ober.


Thanks Mike I'll remember that. Yes they do, which is handy with non
WebPages as well. I have a zip file I wanted to host to everyone not just
my users via ssl and I was able to override the sight security on that file
so it can be served anonymously.

DP
Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by SPuR | last post: by
7 posts views Thread by Scott | last post: by
5 posts views Thread by devgrt | last post: by
reply views Thread by Dave | last post: by
1 post views Thread by Mr. Novice | last post: by
2 posts views Thread by Sergej Prokoviev | last post: by
3 posts views Thread by curt.ziegler | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.