Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14611 reviews 1734 hosting providers

Questions & Answers

Redirect users that are not logged in wordpress Advanced Member

May 27, 2012 by SunFun
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 votes
May 27, 2012 by TopNet
Try using a conditional simple statement and a redirect header
0 votes
May 27, 2012 by lionhost
hi
You can use one of the membership plugins.
0 votes
May 27, 2012 by WebProX
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() );