Page 1 of 1

Force SSL Problems

PostPosted: June 21st, 2011, 7:38 am
by ifanatics
Greetings,

I have spent the entire night trying to figure this out... many hours later, and with no sleep, I'm still ripping my hair out over this, and now my site is not functioning properly.

I have s2member pro, and I'm using pro-forms. I have my SSL certificate installed and working properly on my site.

I'm trying to use the Force SSL feature provided in s2member pro. I cannot figure out how to get this to work.

The instructions say: "You can add the Custom Field s2member_force_ssl = yes to any Post/Page."

This is exactly what I'm trying to do. I read all about using custom fields in wordpress, and no matter how I try to implement this I cannot get it to work.

Could someone please just explain the process in more detail, please? What exactly should I be typing in, and where?

Any help with this is greatly appreciated.

Re: Force SSL Problems

PostPosted: June 21st, 2011, 11:49 am
by Cristián Lávaque
Did you write that in your URL as you quoted it there? That has spaces aroudn the equal sign, which should not be that way in the URL. If you add it at the end of the URL it'd go like this:
http://example.com/pro-form/?s2member_force_ssl=yes

And now you can also just do it like this http://example.com/pro-form/?s2-ssl

I hope that helps. :)

Re: Force SSL Problems

PostPosted: July 1st, 2011, 5:40 pm
by BobTabor
Sorry to hijack a resolved thread ... but ... where are these instructions? I can't find a reference to this (and I know it's in there ... just can't find it). Thanks for a nudge!

Re: Force SSL Problems

PostPosted: July 2nd, 2011, 2:18 am
by Cristián Lávaque
http://www.s2member.com/support/

Do I need an SSL certificate to use PayPal Pro or Authorize.Net?

If you're using s2Member's Pro Forms, then yes. In order to comply with PayPal®, Authorize.Net® and PCI Compliance policies, as set forth by major credit card companies; you will need to host all of your Pro Forms on an SSL enabled site. Please check with your hosting provider to ask about obtaining an SSL certificate for your domain. Please note... when you create Pro Forms using the Form Generators provided by s2Member; you'll be supplied with WordPress Shortcodes, which you'll insert into Posts/Pages of your choosing. These special Posts/Pages will need to be displayed in SSL mode, using links that start with ( https:// ). In other words, when you link to these Posts/Pages, you'll need to make sure your links start with https://.

You can skip the SSL certificate during Development/Sandbox testing. SSL is not required until you officially go live. Once you're live, you can add the Custom Field s2member_force_ssl -> yes to any Post/Page. s2Member will buffer output on those special Posts/Pages, converting everything over to https:// for you automatically, and forcing those specific Posts/Pages to be viewed over a secure SSL connection; so long as your server supports the https protocol. This will help you eliminate the dreaded Secure/Insecure errors in Internet Explorer. If your server runs SSL over a special port number, or your server requires the port number to actually be in the URL ( i.e. HOST:port ), you can set s2member_force_ssl -> 443; or to whatever port you need.


:)

Re: Force SSL Problems

PostPosted: July 2nd, 2011, 9:17 am
by BobTabor
HOLY CRAP ... I just did this, and it worked so beautifully I want to cry. I thought this would be a simple redirect for the page itself and I would have to go through and figure out how to modify my template, my images and external javascript references to also be redirected to HTTPS ... BUT NO ... you guys did this. I actually lost a little sleep last night worrying about how I was going to do this. AWESOME CRAFTSMANSHIP.

Re: Force SSL Problems

PostPosted: July 2nd, 2011, 12:58 pm
by BobTabor
Unfortunately, my tears of joy have turned into tears of sorrow.

First, I'm using ThemeMyLogin to give the user a non-WordPress experience. I know you're not responsible for this product, however (a) I'm hoping you can still point me in the right direction, and (b) it may uncover a small bug in how you handle Welcome page + replacement codes.

(1) I've configured my site to have a Welcome page replacement-code scheme like so:

http://members.learnvisualstudio.net/welcome-%%current_user_level%%

Produces:

http://members.learnvisualstudio.net/welcome-0
http://members.learnvisualstudio.net/welcome-1
etc.

This worked beautifully.

(2) Then, I applied the s2member_force_ssl -> yes to each page that hosts the [ThemeMyLogin] login.

This worked as well . . . I can see that the pages are all SSL.

(3) When a member attempts to login, however, they do not see the Welcome page w/ replacement codes! INSTEAD they go to the WordPress Administration screen!

(Let me give you two scenarios … feel free to try this yourself using example / example … I'll leave this user/pass up until I hear from you.)

So, in this first walkthrough, I have set the Home page's s2member_force_ssl -> yes.

I navigate here:

http://members.learnvisualstudio.net

… which redirects to here …

https://members.learnvisualstudio.net/?s2-ssl=yes

… then I login … and am redirected here ...

https://members.learnvisualstudio.net/wp-admin/

… which is not right.


In this second scenario, the Login page, I did NOT set the s2member_force_ssl -> yes.

http://members.learnvisualstudio.net/login/

… Obviously, not redirected, so I login ...

http://members.learnvisualstudio.net/welcome-4/

… which is the desired behavior.

So …

(1) Am I doing something wrong?
(2) Is there some workaround?

Re: Force SSL Problems

PostPosted: July 2nd, 2011, 5:35 pm
by Cristián Lávaque
There may be a conflict between the redirection URL for the Login Welcome when using the s2-SSL parameter. I'll notify Jason so he checks it out. Thanks for reporting it!

What versions are you running of s2Member, s2Member Pro and WordPress?

Re: Force SSL Problems

PostPosted: July 2nd, 2011, 9:10 pm
by BobTabor
WordPress 3.1.3

S2Member Version: 110620

S2Member Pro Version: 110606

Re: Force SSL Problems

PostPosted: July 2nd, 2011, 11:39 pm
by Jason Caldwell
Thanks for reporting this important issue.

I just took a look at your site, and this seems to be related to the "redirect_to" variable being set inside your Login Widget. Please take a look at this troubleshooting video, I think this will help you out:
http://www.s2member.com/login-welcome-p ... cts-video/

Possible solution for you. Use the s2Member Pro Login Widget, as it provides much more flexibility in this regard. In other words, the s2Member Pro Login Widget ( which comes with s2Member Pro ), allows you to configure this when you add the widget.

Re: Force SSL Problems

PostPosted: July 3rd, 2011, 7:46 am
by BobTabor
Whew ... first, the video helped A LOT. Thank you for that. I apologize for not investigating your full library of videos first on this matter.

Second, the s2Member Pro Login Widget wasn't an option because of where I wanted to put it -- not in a sidebar, but simply on three or four key pages (home, login, pricing, etc.)

Third, I resolved this using ThemeMyLogin by doing the following:

(1) As you suggested, I searched for all occurrances of "redirect_to" and found that it was contained in the login-form.php, which is in the \templates\ folder of ThemeMyLogin.

(2) Per their instructions, I copied this file into the root of my theme folder. I did this to make changes to it. Doing this overrides the default behavior of ThemeMyLogin.

(3) I simply removed the line completely (for me, it was line 33) ... so this line is gone now:

Code: Select all
<input type="hidden" name="redirect_to" value="<?php $template->the_redirect_url( 'login' ); ?>" />


(4) Upon testing, it seems to work perfectly. I'll need to do more testing, but I think this resolved the issue.

Again, Jason (and Cristian) thank you so much for your help! Especially on a holiday weekend! You guys are awesome!

Re: Force SSL Problems

PostPosted: July 3rd, 2011, 12:42 pm
by Jason Caldwell
You are VERY welcome.
For future reference, and for the benefit of other readers.
The s2Member Pro Login Widget can be installed at any location you like using the PHP tag method described in this tutorial. There is also a section inside your Dashboard that covers this, under:
s2Member -> API Scripting -> Pro Login Widget via PHP tag.

Reference articles:
viewtopic.php?f=36&t=2610
viewtopic.php?f=36&t=2781