I am trying to secure a folder within my site by forcing an HTTPS connection when anything in this folder is run (the folder contains a series of scripts that process registrations, password resets, etc). What's the easiest way to accomplish this?

If you're using Apache you could use mod_rewrite with htaccess and have it redirect all requests to an HTTPS protocol. You would just need to drop the htaccess file into that folder and use something like this inside of that file.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

You may need to modify this but that is the basic idea. I don't do IIS much so I really don't know what the equivalent produce would be for that.

Here are some more examples http://www.askapache.com/htaccess/http-https-rewriterule-redirect.html

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.