Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub-folder does not show green padlock

Status
Not open for further replies.

SitesMasstec

Programmer
Sep 26, 2010
508
Brasil
Hello colleagues!

I have a valid SSL Certificate for a domain www.masstec.com.br. When this website address is typed the green locker appears. It is ok.

But when typed www.masstec.com.br/receitas, the page is loaded but the green padlock does not appear in the address bar. I have already changed all HTTP to HTTPS in the HTML index.htm file inside the sub-folder.

What is missing?

Please see the image.

ProblemaCadeadoVerde1english_lrjsnx.jpg


Thank you,
SitesMasstec
 
The page probably requests other items/elements that are NOT served via HTTPS.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Hello Chris!

I have already changed all references http:// to https://

Please see my other image illustrating the problem:
(I have SSL certificate for the main domain
roteiro123aenglish_tzlbfy.jpg


Thank you,
SitesMasstec
 
what is the FULL code of the redirect, given that without that this ISN'T an ASP problem just a browser issue.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Hello Chris!

Please note that the Microsoft IIS server (where my sites are hosted) is NOT defined as an HTTPS server, because I have only one SSL certificate, for the masstec.com.br domain.

The photogaleria.com.br domain is in the same sarver, but it has NOT an SSL certificate.


This is the full code of the DEFAULT.ASP file:
Code:
<HTML>

<HEAD>
<link rel="shortcut icon" href="favicon.ico" >
<!--link rel="icon" href="animated_favicon.gif" type="image/gif" -->
<TITLE>Redirect</TITLE>
</HEAD>

<BODY>


<% 
URL = Request.ServerVariables("SERVER_NAME") 

Select Case URL 

Case "[URL unfurl="true"]www.masstec.com.br"[/URL] 
Response.Redirect "[URL unfurl="true"]https://www.masstec.com.br/masstec/"[/URL] 
Case "masstec.com.br" 
Response.Redirect "[URL unfurl="true"]https://masstec.com.br/masstec/"[/URL] 

Case "[URL unfurl="true"]www.masstec.com.br/receitas"[/URL] 
Response.Redirect "[URL unfurl="true"]https://www.masstec.com.br/receitas/"[/URL] 
Case "masstec.com.br/receitas" 
Response.Redirect "[URL unfurl="true"]https://masstec.com.br/receitas/"[/URL] 


Case "[URL unfurl="true"]www.photogaleria.com.br"[/URL] 
Response.Redirect "/photogaleria/" 
Case "photogaleria.com.br" 
Response.Redirect "/photogaleria/" 

End Select 
%>  


</BODY>
</HTML>

Thank you,
SitesMasstec
 
Right, so you DO NOT check for https BEFORE redirecting but just redirect to https in all cases and THAT is the problem.


Code:
<%
   If Request.ServerVariables("SERVER_PORT")=80 Then
      Dim SSL_URI
      SSL_URI = "[URL unfurl="true"]https://"[/URL]
      SSL_URI = SSL_URI & Request.ServerVariables("SERVER_NAME")
      SSL_URI = SSL_URI & Request.ServerVariables("URL")
      Response.Redirect SSL_URI
   End If
%>

Should solve the problem. Save it to a file and include at the start of every ASP file.

You can also insert a conditional check and insert for 'www' as required.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Hello Chris!

I saved the code you sent to the PARAHTTPS.ASP file, and saved it in the root directory of the Server.

Then I put in the first line of the DEFAULT.ASP file (which treats the redirections, also in the root directory of the Server) the following code:
Code:
<!--#include file="parahttps.asp" -->

Then I typed in the Chrome browser (as anonimous) and the green padlock did not appeared, as the site is considered 'not secure'.

The site has no other ASP files, just the DEFAULT.ASP file, which does redirections.

I appreciare your try to help me.



Thank you,
SitesMasstec
 
Hello Chris!

Will I have to modify the code you provided above?

Code:
<%
   If Request.ServerVariables("SERVER_PORT")=80 Then
      Dim SSL_URI
      SSL_URI = "[URL unfurl="true"]https://"[/URL]
      SSL_URI = SSL_URI & Request.ServerVariables("SERVER_NAME")
      SSL_URI = SSL_URI & Request.ServerVariables("URL")
      Response.Redirect SSL_URI
   End If
%>

Do I have to put/change information or no change is necessary?


Thank you,
SitesMasstec
 
You need to use root relative addressing when the include file is in the root folder and the requested file is in a subfolder.

Code:
<!--#include file="/parahttps.asp" -->


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top