Link to home
Start Free TrialLog in
Avatar of Shade22
Shade22Flag for United States of America

asked on

HTML login page to redirect to a .ASP file in a secure folder.

I recently added SSL to my site securing a certain folder making all docuements there start with "HTTPS" prior to the domain name.  Anything outside that folder can be just have a "HTTP" in front of the domain.  The problem I am having is I have a form field where the user log's  in, and that is located on the index.htm file which is outside of the secure folder.  When I try to log in it sends me to an error page (example#1).  I am able to add an "S" onto the domain making it an "https", but not everyone would know how to do that and it would also be a hassle.  My question is, how do I make a login form in "html" file outside my secure folder redirect to a .asp file in a secure folder?


(example#1)
The page must be viewed over a secure channel
The page you are trying to access is secured with Secure Sockets Layer (SSL).

Please try the following:

    Type https:// at the beginning of the address you are attempting to reach and press ENTER.

HTTP Error 403.4 - Forbidden: SSL is required to view this resource.
Internet Information Services (IIS)

Technical Information (for support personnel)

    Go to Microsoft Product Support Services and perform a title search for the words HTTP and 403.
    Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled About Security, Secure Sockets Layer (SSL), and About Custom Error Messages.

<form action="./securepages/login_direct.asp" method="post" id="Form2" name="Form2">
              <table border="0" width="25%" id="table2">
                <tr>
                  <td width="50%" align="right"><strong>User Id&nbsp;&nbsp;</strong></td>
                  <td width="50%"><input type="text" id="fuserid" name="fuserid" size="13" maxlength="12" /></td>
                </tr>
                <tr>
                  <td width="50%" align="right"><strong>Password&nbsp;&nbsp;</strong></td>
                  <td width="50%"><input type="password" name="fpswd" size="13" maxlength="12" /></td>
                </tr>
                <tr>
                  <td width="50%"></td>
                  <td width="50%"></td>
                </tr>
                <tr>
                  <td width="50%" align="right"><input type="submit" value="Submit" name="B1" onclick="passedEdit()" /></td>
                  <td width="50%"><input type="button" value="Reset" name="B2" onclick="clearText(document.Form2.fuserid,document.Form2.fpswd)" /></td>
                </tr>
              </table>
			  <br />
              <p>Not a member yet?<br /> 
              <a href="createlogin.htm"> Create a Member Login Account</a></p>
		      <p align="center">If you have <a href="fgtpswd.htm">forgotten </a>your password for your existing Login Account. </p>
		      </form>

Open in new window

Avatar of pateljitu
pateljitu
Flag of Canada image

Would suggest you to auto re-direct your login page in HTML to https:// using code as provided below:

<meta HTTP-EQUIV="REFRESH" content="0; url=https://www.yourdomain.com/loginform.html">
Avatar of Shade22

ASKER

I know I can do that, but I wanted to know if and how I would go about going from login in on a unsecure page to redirecting to a secure page. I have seen several sights do this, but just don't know how the code it.
ASKER CERTIFIED SOLUTION
Avatar of pateljitu
pateljitu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shade22

ASKER

Thank you for the info.  I guess I will convert the whole site to be under an SSL.