Page 2 of 2

Re: Safari is redirected to login

PostPosted: May 10th, 2011, 11:45 am
by Cristián Lávaque
It won't affect you, Anna, because nothing will change for search engines, just for web browsers. :)

Re: Safari is redirected to login

PostPosted: May 10th, 2011, 1:22 pm
by AnnaSkye
Thank you for the reassurance. I will add the hack recommended and report back my findings. Thanks!

Re: Safari is redirected to login

PostPosted: May 10th, 2011, 2:08 pm
by Cristián Lávaque
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.

Re: Safari is redirected to login

PostPosted: May 10th, 2011, 6:29 pm
by Jason Caldwell
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.