Redirect users that are not logged in wordpress Advanced Member

192 views
asked May 27, 2012 in Website Builder by SunFun (3,000 points)
hello
I have a  wordpress website that has a private page within it. If you  type the url and you are not logged in you will get  404 error. I want to redirect users that are not logged in from this private page to the homepage instead of the 404 page. Does anyone know how to do this?

Thanks

3 Answers

0 like 0 dislike
answered May 27, 2012 by TopNet (10,360 points)
Try using a conditional simple statement and a redirect header
0 like 0 dislike
answered May 27, 2012 by lionhost (4,060 points)
hi
You can use one of the membership plugins.
0 like 0 dislike
answered May 27, 2012 by WebProX (12,200 points)
You can use the users ID  with the function get_current_user_id(); and then create a redirect around it with the function php wp_redirect( home_url() );
...