PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Safari is redirected to login

s2Member Plugin. A Membership plugin for WordPress®.

Re: Safari is redirected to login

Postby Cristián Lávaque » May 10th, 2011, 11:45 am

It won't affect you, Anna, because nothing will change for search engines, just for web browsers. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Safari is redirected to login

Postby AnnaSkye » May 10th, 2011, 1:22 pm

Thank you for the reassurance. I will add the hack recommended and report back my findings. Thanks!
User avatar
AnnaSkye
Registered User
Registered User
 
Posts: 23
Joined: May 4, 2011

Re: Safari is redirected to login

Postby Cristián Lávaque » May 10th, 2011, 2:08 pm

Oh, you were talking about the hack earlier in the thread? I'm very sorry, that one doesn't separate search engine spiders from web browsers, I thought you were asking about the fix for the next release, which is what was mentioned in the post right above your question. :|

You could try this in your hack in the meantime. Note: I haven't tested it.

Code: Select all
<?php
add_filter
('ws_plugin__s2member_content_redirect_status', 'content_redirect_status');
function content_redirect_status($status = 301) { 
    if 
((int)$status === 301 && !empty($_SERVER['HTTP_USER_AGENT']) && preg_match('~(msie|trident|gecko|webkit|presto|konqueror|playstation)[/ ]([0-9\.]+)~i', $_SERVER['HTTP_USER_AGENT']))
        return ($status = 302); 
}
?>


I hope it helps.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Safari is redirected to login

Postby Jason Caldwell » May 10th, 2011, 6:29 pm

I agree with Cristián's hack.
Until the next release comes out, I recommend creating this file and directory.
( this hack can be deleted once the next release is available )

/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter
('ws_plugin__s2member_content_redirect_status', 'content_redirect_status');
function content_redirect_status($status = 301) { 
    if 
((int)$status === 301 && !empty($_SERVER['HTTP_USER_AGENT']) && preg_match('~(msie|trident|gecko|webkit|presto|konqueror|playstation)[/ ]([0-9\.]+)~i', $_SERVER['HTTP_USER_AGENT']))
        return ($status = 302); 
}
?>
* When implemented like this, there should be no negative side effects.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Previous

Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 3 guests

cron