latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Redirect a 503?

Home Forums Community Forum Redirect a 503?

This topic contains 6 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 7 months ago.

Topic Author Topic
Posted: Monday May 21st, 2012 at 8:42 pm #14118

Instead of showing a 503 on a plain white screen after an IP restriction breach, is there a way to redirect to a custom error page?

I saw Jason’s code for adjusting the length of time of the IP restrictions, but I don’t think that will help redirect. I’m pretty new to using actions/filters/hooks.

add_filter ("ws_plugin__s2member_ip_restrictions__concurrency_time_per_ip", "s2_concurrency_time_per_ip");
function s2_concurrency_time_per_ip ()
    {
	return "24 hours";
    }

Thank you,
Kenny

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Tuesday May 22nd, 2012 at 9:53 pm #14232

Hi Kenny.

I’m not sure, I’ll ask Jason about it. :)

Posted: Thursday May 24th, 2012 at 2:12 am #14397
Staff Member
Yes, this is possible.

Here’s an example of how one might go about it.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_action('ws_plugin__s2member_during_ip_restrictions_ok_no', 'my_redirect');
function my_redirect(){
	wp_redirect('http://www.example.com/ips-limit-message/'); exit;
}
?>
Posted: Thursday May 24th, 2012 at 2:17 am #14398

Thank you, Jason. That’ll help keep the error page on brand and editable by the client. I’m using the restriction to help prevent credential sharing.

Thanks!

Posted: Thursday May 24th, 2012 at 2:21 am #14400

Thanks Jason. :)

Kenny, in case it helps you, I asked Jaosn about the Brute Force restriction and he said the hack is the same, but with the hook [hilite mono]ws_plugin__s2member_during_stop_brute_force_logins[/hilite].

Posted: Thursday May 24th, 2012 at 2:27 am #14402

Thanks Cristian! Controlling error pages is an important part of keeping users involved in the brand, even if their intentions are sneaky, but mostly for when it’s a glitch or an accident. Both of these hooks will help cover the bases.

Posted: Thursday May 24th, 2012 at 2:29 am #14404

I agree. :)

Viewing 6 replies - 1 through 6 (of 6 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.