help regarding HTTPS and HTTP

H

hpatel

Hi,

I maintain a website for my organization. Recently, for a login page,
I started using HTTPS. It works fine with HTTPS.

The problem I face is : When a user goes to login page, he sees the
login page via HTTPS. Now, if user doesn't submit the login form but
chooses to browse some other link on the same page, that page will
still be shown using HTTPS because links are relative. This increases
unnecessary HTTPS traffic on the server.

I need a solution that can help me to change protocol back to HTTP if
the user doesn't submit login form. I have written small piece of
java script that can check at the time of leaving the page. If submit
button wasn't pressed, it should change the protocol back to HTTP. I
have played around window.location object trying to change it's href
property.


<code>
window.onunload = function()
{

// if submit button wasn't pressed, change the protocol back to
HTTP

if (!submitPressed)
{

window.location.protocol="http:";
alert(windows.location.href);
window.location.port = "80";

}
</code>


Please let me know if you know about some simple solution.
 
T

Thomas 'PointedEars' Lahn

The problem I face is : When a user goes to login page, he sees the
login page via HTTPS. Now, if user doesn't submit the login form but
chooses to browse some other link on the same page, that page will
still be shown using HTTPS because links are relative. This increases
unnecessary HTTPS traffic on the server.

I need a solution that can help me to change protocol back to HTTP if
the user doesn't submit login form. I have written small piece of
java script that can check at the time of leaving the page. If submit

It's Netscape/Mozilla.org _JavaScript_, Microsoft JScript, or ECMAScript.
button wasn't pressed, it should change the protocol back to HTTP. I
have played around window.location object trying to change it's href
property.

[snipped nonsensical script code]

Please let me know if you know about some simple solution.

<head>
...
<base href="http://example.com">
...
</head>

<body>
...
<form action="https://example.com/form" ...>
...
</form>
...
</body>

You could rewrite the URLs server-side as well:
http://httpd.apache.org/docs/2.2/misc/rewriteguide.html


PointedEars
 
H

hpatel

The problem I face is : When a user goes to login page, he sees the
login page viaHTTPS. Now, if user doesn't submit the login form but
chooses to browse some other link on the same page, that page will
still be shown usingHTTPSbecause links are relative. This increases
unnecessaryHTTPStraffic on the server.
I need a solution that can help me tochangeprotocolback toHTTPif
the user doesn't submit login form. I have written small piece of
java script that can check at the time of leaving the page. If submit

It's Netscape/Mozilla.org _JavaScript_, Microsoft JScript, or ECMAScript.
button wasn't pressed, it shouldchangetheprotocolback toHTTP. I
have played around window.location object trying tochangeit's href
property.
[snipped nonsensical script code]
Please let me know if you know about some simple solution.

<head>
...
<base href="http://example.com">
...
</head>

<body>
...
<form action="https://example.com/form" ...>
...
</form>
...
</body>

You could rewrite the URLs server-side as well:http://httpd.apache.org/docs/2.2/misc/rewriteguide.html

PointedEars

Thanks for the reply. But, I don't want to use absolute paths. I just
want to catch the URL of clicked Link. And, then, I can just change
"https://domain.com/path1" to "http://domain.com/path" if I am able to
get the URL of the clicked link.
 
T

Thomas 'PointedEars' Lahn

[...]
I need a solution that can help me tochangeprotocolback toHTTPif
the user doesn't submit login form. I have written small piece of
java script that can check at the time of leaving the page. If submit
button wasn't pressed, it shouldchangetheprotocolback toHTTP. I
have played around window.location object trying tochangeit's href
property.
[snipped nonsensical script code]
Please let me know if you know about some simple solution.
[...]
You could rewrite the URLs server-side as well:http://httpd.apache.org/docs/2.2/misc/rewriteguide.html
[...]

Thanks for the reply. But, I don't want to use absolute paths. I just
want to catch the URL of clicked Link. And, then, I can just change
"https://domain.com/path1" to "http://domain.com/path" if I am able to
get the URL of the clicked link.

If you had quoted properly, i.e. only the lines you were actually
referring to, you would have spotted the solution within.

http://www.jibbering.com/faq/faq_notes/clj_posts.html


PointedEars
 
H

hpatel

(e-mail address removed) wrote:
[...]
I need a solution that can help me tochangeprotocolback toHTTPif
the user doesn't submit login form. I have written small piece of
java script that can check at the time of leaving the page. If submit
button wasn't pressed, it shouldchangetheprotocolback toHTTP. I
have played around window.location object trying tochangeit's href
property.
[snipped nonsensical script code]
Please let me know if you know about some simple solution.
[...]
You could rewrite the URLs server-side as well:http://httpd.apache.org/docs/2.2/misc/rewriteguide.html
[...]
Thanks for the reply. But, I don't want to use absolute paths. I just
want to catch the URL of clicked Link. And, then, I can justchange
"https://domain.com/path1" to "http://domain.com/path" if I am able to
get the URL of the clicked link.

If you had quoted properly, i.e. only the lines you were actually
referring to, you would have spotted the solution within.

http://www.jibbering.com/faq/faq_notes/clj_posts.html

PointedEars

Oh...! Sorry!!

I am still not clear about the solution. Can u pls specifically
mention it?
 
T

The Natural Philosopher

On Nov 13, 4:18 pm, Thomas 'PointedEars' Lahn <[email protected]>
wrote:
(e-mail address removed) wrote:
[...]
I need a solution that can help me tochangeprotocolback toHTTPif
the user doesn't submit login form. I have written small piece of
java script that can check at the time of leaving the page. If submit
button wasn't pressed, it shouldchangetheprotocolback toHTTP. I
have played around window.location object trying tochangeit's href
property.
[snipped nonsensical script code]
Please let me know if you know about some simple solution.
[...]
You could rewrite the URLs server-side as well:http://httpd.apache.org/docs/2.2/misc/rewriteguide.html
[...]
Thanks for the reply. But, I don't want to use absolute paths. I just
want to catch the URL of clicked Link. And, then, I can justchange
"https://domain.com/path1" to "http://domain.com/path" if I am able to
get the URL of the clicked link.
If you had quoted properly, i.e. only the lines you were actually
referring to, you would have spotted the solution within.

http://www.jibbering.com/faq/faq_notes/clj_posts.html

PointedEars

Oh...! Sorry!!

I am still not clear about the solution. Can u pls specifically
mention it?

Unlikely from that source. Why give a simple clear explanation that
takes 30 seconds when you can take 45 seconds to point someone at a
site, cause them wasted time, and make them look stupid as well?
 
T

Thomas 'PointedEars' Lahn

On Nov 13, 4:18 pm, Thomas 'PointedEars' Lahn <[email protected]>
wrote:
(e-mail address removed) wrote:
[...]
I need a solution that can help me tochangeprotocolback toHTTPif
the user doesn't submit login form. I have written small piece of
java script that can check at the time of leaving the page. If submit
button wasn't pressed, it shouldchangetheprotocolback toHTTP. I
have played around window.location object trying tochangeit's href
property.
[snipped nonsensical script code]
Please let me know if you know about some simple solution.
[...]
You could rewrite the URLs server-side as well:
http://httpd.apache.org/docs/2.2/misc/rewriteguide.html ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
Thanks for the reply. But, I don't want to use absolute paths. I just
want to catch the URL of clicked Link. And, then, I can justchange
"https://domain.com/path1" to "http://domain.com/path" if I am able to
get the URL of the clicked link.
If you had quoted properly, i.e. only the lines you were actually
referring to, you would have spotted the solution within.

http://www.jibbering.com/faq/faq_notes/clj_posts.html
[signature]

Oh...! Sorry!!

I'd rather you quoted properly this time as explained in the FAQ Notes.

You also should get a decent newsreader which does not have Google Groups'
fault to remove whitespace in quotes seemingly in a random manner.
I am still not clear about the solution. Can u pls specifically
mention it?

URL Rewrite with Redirect:

http://httpd.apache.org/docs/2.2/misc/rewriteguide.html


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top