nsForum logo

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> Force Ssl, Need to make HTTP redirect to HTTPS
Kaleb
post Jan 15 2010, 12:55 PM
Post #1





Group: Verified NS Member
Posts: 2
Joined: 17-July 09
Member No.: 4,795



I need to redirect HTTP traffic to HTTPS automatically. Currently I am using javascript but I want it to be done by the web server. How do I set that up?

I dont want to rely on javascript to make my site redirect to https.

Thank You
Go to the top of the page
 
+Quote Post
Corey
post Jan 16 2010, 12:45 AM
Post #2


Network Solutions Technical Support


Group: Administrators
Posts: 173
Joined: 23-June 08
Member No.: 1,316



QUOTE (Kaleb @ Jan 15 2010, 01:03 PM) *
I need to redirect HTTP traffic to HTTPS automatically. Currently I am using javascript but I want it to be done by the web server. How do I set that up?

I dont want to rely on javascript to make my site redirect to https.

Thank You


Network Solutions runs the SSL through a proxy so you are unable to do this via server side variables. JavaScript redirection is the best solution in this case.
Go to the top of the page
 
+Quote Post
Kaleb
post Jan 18 2010, 09:00 AM
Post #3





Group: Verified NS Member
Posts: 2
Joined: 17-July 09
Member No.: 4,795



QUOTE (Corey @ Jan 16 2010, 12:53 AM) *
Network Solutions runs the SSL through a proxy so you are unable to do this via server side variables. JavaScript redirection is the best solution in this case.


Is there another product or addon that NetworkSolutions offers to do this server side?
Go to the top of the page
 
+Quote Post
Susan013
post Jan 19 2010, 03:21 PM
Post #4





Group: NetSol Staff
Posts: 89
Joined: 3-December 09
Member No.: 6,342



QUOTE (Kaleb @ Jan 18 2010, 09:08 AM) *
Is there another product or addon that NetworkSolutions offers to do this server side?


Our proxy SSL doesn't allow server-side variables to detect HTTPS (secure). All server-side coding will always detect HTTP (non-secure), and for programs that attempt to redirect non-secure connections (http://) to a secure connection (https://) will result in an infinite loop and server error after 30 seconds.

The only ways around this is to
assume the connection is secure by making all the links to the sensitive pages https, or

use a client-side program (like javascript) to detect if it's secure and redirect if it's not. The coding below will do just that. Just modify it to redirect to the correct secure domain and add it into the HTML of any sensitive pages.

CODE
<script language="javascript">
if (document.location.protocol != "https:")
{
document.location.href = "https://secure.domain.com" + document.location.pathname;
};
</script>


We also offer VPS hosting if you are comfortable with running your own server and it is a better suit for your needs.
I hope that helps,
Go to the top of the page
 
+Quote Post
Karlos
post Apr 14 2010, 01:01 PM
Post #5





Group: Verified NS Member
Posts: 1
Joined: 14-April 10
Member No.: 9,149



QUOTE (Susan013 @ Jan 19 2010, 04:21 PM) *
..use a client-side program (like javascript) to detect if it's secure and redirect if it's not. The coding below will do just that. Just modify it to redirect to the correct secure domain and add it into the HTML of any sensitive pages.

CODE
<script language="javascript">
if (document.location.protocol != "https:")
{
document.location.href = "https://secure.domain.com" + document.location.pathname;
};
</script>


I've used Joomla to build my site (installed in a subdirectory named "joomla") which has components which need to be secure. I've purchased an SSL certificate from NetSol for the domain. Where do I add the code you've provided? I tried adding it to the header of the template page and it caused problems. How else can the code be used?
Go to the top of the page
 
+Quote Post
vsWilly
post Jun 8 2010, 11:06 PM
Post #6





Group: Verified NS Member
Posts: 1
Joined: 8-June 10
Member No.: 9,909



QUOTE (Susan013 @ Jan 19 2010, 03:21 PM) *
We also offer VPS hosting if you are comfortable with running your own server and it is a better suit for your needs.
I hope that helps,

How will VPS hosting allow server-side variables to detect HTTPS (secure). ?


Go to the top of the page
 
+Quote Post
kindground
post Jul 18 2012, 09:34 PM
Post #7





Group: Verified NS Member
Posts: 1
Joined: 18-July 12
Member No.: 17,965



This is absolutely ridiculous that NS runs their SSL this way. There are a ton of Open Source applications that use server detection to determine if SSL is needed or being used....that WILL NOT be compatible with NS shared hosting.
Go to the top of the page
 
+Quote Post
kyboy
post Aug 7 2014, 08:39 PM
Post #8





Group: Verified NS Member
Posts: 181
Joined: 31-August 08
From: ky
Member No.: 2,243



No server side detecion? What?

I have a Windows hosting plan and use classic asp, For those pages that must use SSL (HTTPS), I have my asp script retrieve the server variable HTTPS, which if set to 'https' lets me know if the request came in via HTTPS. If not, I have the asp script redirect to the same asp page but with an explicit HTTPS:// specified in the redirect URL.

I'm new to SSL, but seems to work for me.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2011 Time is now: 18th January 2018 - 10:36 AM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates