Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Wordpress 

Redirect Homepage to login page

okay guys, heres the problem,

I got a site and I wanted to redirect the users to the login page when they visited, so what I did was download the Redirection plugin, and made a 301-redirect from site.xyz to site.xyz/login , so now, whenever the user logs in, it is redirected to the login page again, how do I solve that problem?

The problem being :

on visiting site -> redirect to login page -> after login redirect to login page again (as set the rules by the Redirection plugin)

The solution I want.

on visiting site -> redirect to login -> after login, redirect to a subdomain where the user can view the site

any help is apprecited. thanks!
Why don't you just use WishList Member plugin and make the whole WordPress site a members only ??
Make a new plugin (or add the code to your theme's functions.php) using the is_front_page() and the wp_redirect() function. PM me if you want me to make a custom plugin for you (for free, it's simple. But if you want to learn programming i'd reccommend to try it yourself).
Русский - Веб-разработчик - эксперт Linux
The easiest way to do this is to add the below code into the top of your header.php

PHP Code

<?php
if (!is_user_logged_in()) {
 
wp_redirect( 'http://www.YourWebsiteURL.com/');
 exit; 
} 
?>

Keep in mind that this means only users who are logged in will be able to view your website, if they are not logged in they will be redirected to the login-page.

Let me know how it goes :)
(Aug 16, 2015 02:08 PM)система Wrote:  Make a new plugin (or add the code to your theme's functions.php) using the is_front_page() and the wp_redirect()function. PM me if you want me to make a custom plugin for you (for free, it's simple. But if you want to learn programming i'd reccommend to try it yourself).

Thanks for this, already used a method!

(Aug 16, 2015 10:36 PM)focuss Wrote:  The easiest way to do this is to add the below code into the top of your header.php

Keep in mind that this means only users who are logged in will be able to view your website, if they are not logged in they will be redirected to the login-page.

Let me know how it goes :)
I used this method on site. and it works perfectly.

Thanks for your response everyone. Someone can now close this thread :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Homelesshacker1406Feb 16, 2026 03:10 AM 2 161 Feb 16, 2026 03:10 AM
Last Post: BlackRock
by Homelesshacker1406Jul 30, 2025 02:16 PM 1 114 Jul 30, 2025 02:16 PM
Last Post: Dark Lord of Tech
by Homelesshacker1406Jul 8, 2025 02:00 PM 10 399 Jul 8, 2025 02:00 PM
Last Post: localpatriot