close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

SSL Redirect for purchases

Thread began 3/06/2011 8:52 pm by Erikk D. Lee | Last modified 3/11/2011 7:04 am by Jason Byrnes | 2994 views | 13 replies |

Erikk D. Lee

SSL Redirect for purchases

Quick questions.. we are running eCart and setup a new SSL certificate on the domain.. so that both http and https work for www.oursite.com and oursite.com. Not sure the best way to setup our customers to redirect to the new SSL side when they signup for a new account or make a purchase. If you could point us in the right direction that would be great..

PS.. I read some of the help docs but they cover if you are running a different subdomain like secure.oursite.com...

Thanks Guys..

Sign in to reply to this post

Dave BuchholzBeta Tester

You would need to redirect your customers to be covered by the SSL when they are checking out.

At the top of your checkout.php page add this code

php:
<?php
if (!isset($_SERVER['HTTPS']) || (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'on')) { 
    
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
    die();
}
?>



then if you ever want to force back from https to the regular site then use:


php:
<?php 
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { 
    
header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
    die();

?>



This will redirect you customers to the SSL side to checkout

Sign in to reply to this post

Erikk D. Lee

Thanks Dave.. will try that for checkout...

Can I use the same thing to redirect customers when they click on the link for Registration i.e. Users_Registration.php or Login i.e. Users_Login.php.

What's the best way to have them use the SSL Cert to protect their data and login information.

Sign in to reply to this post

Jason ByrnesWebAssist

add that code at line 1 of any page on your site that should be viewed using the https address only.

Sign in to reply to this post

Erikk D. Lee

Unfortunately the code did not work..

That would have been great if it was that simple :(

We added the code to several pages... verified that the changes were made and tested it as many ways as we could think of but no luck. When we did the tests the pages just come up normal... that is they do not start using the SSL.

Any ideas..

Sign in to reply to this post

Jason ByrnesWebAssist

create a new blank php page and add the following code to it:

php:
HTTPS? :<?php echo($_SERVER['HTTPS']); ?>




this will tell us whether the HTTPS has been enabled at the server level.

Sign in to reply to this post

Erikk D. Lee

Ok.. we did the test.. here is what we get back.

HTTPS? :off


The SSL Cert works fine when you go to www.oursite.com or oursite.com

The server is a Windows 2003 running of course IIS6

Sign in to reply to this post

Jason ByrnesWebAssist

based on those results, the if statement should be working.

I would question whether the updated pages are being uploaded to the server correctly.

on one of the pages where yo added the if statement, make a design change in the body like adding today's date then upload it again and test. If you dont see today's date on the page, the upload is failing.

Sign in to reply to this post

Erikk D. Lee

We did one step further and made the changes directly to the pages on the server.. we also verified by changing the page titles.

Is there another way for us to just change the links in the database or something similar.

If you have any other tests we can do we would be happy to try them.

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of one of the pages you added the if statement to and a link where i can see the problem.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...