If you want to create a login-based website and need to redirect all your visitors to the login page, add this code to your theme’s functions.php file.
function protect_whole_site() {
if (!is_user_logged_in()) {
if (isset($_SERVER['REQUEST_URI'])) {
$url = untrailingslashit($_SERVER['REQUEST_URI']);
if (strpos($url, HMWP_Classes_Tools::getOption('hmwp_login_url')) === false) {
wp_redirect(site_url('wp-login.php'));
exit();
}
} else {
wp_redirect(site_url());
exit();
}
}
}
add_action('template_redirect', 'protect_whole_site'); If you have Ghost mode activated in WP Ghost, the redirect will made to the new login path.
Because hackers often use bots to search for security flaws in your website, it is…
The easiest way to change the default media uploads path is to use the WP…
To hide all CSS and JS you need to follow the steps to Combine the…
https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…
The security of your WordPress site depends on multiple factors, such as the strength of…
When you enable two-factor authentication (2FA) for your WordPress website, it adds an extra layer…
Hi John, I was just wondering if you would be interested in building couple of plugins for me for my project? If yes, please reach out to me via email: niishcloud@gmail.com
Thank you so much!!!