Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Change 404s to Login Page

UserPost

2:25 pm
August 7, 2008


Aarontcp

Member

posts 4

1

Hi,

I spent most of this morning setting up role scoper to use alongside WP 2.6 and amember.

I have no idea if this is a wordpress or amember or role scoper issue, but I thought I'd ask :)

Something that I haven't been able to work out is this-

If I set a page to private, and restrict its access to a certain role/user-group… when logged in as a member of that user group I can see the page fine.

However, if I am just browsing the site anonymously and type in the "hidden" URL, then I get a 404 error. Is there anyway to instead redirect those anonymous users to a login page (or any other specified page for that matter)?

Cheers,

- Aaron

3:40 pm
August 7, 2008


Kevin

Admin

posts 2402

2

I think that would be best handled by putting a redirect in your your theme's 404.php

If you wanted to get a little more sophisticated, you could do the login redirect only for anon users:

global $current_user;
if ( empty($current_user->ID) )
    header ( 'Location: http://yourloginurl/' );

4:49 pm
August 7, 2008


Aarontcp

Member

posts 4

3

Thanks, I'll give it a go!

Cheers,

- Aaron


About the Agapetry forum

Currently Online:

15 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1186

Posts: 5409

Members:

There are 1176 members

There are 1 guests


Kevin has made 2402 posts

Top Posters:

metal450 - 159

Ragnar - 105

YikYak - 70

whiteorb - 44

Daisy - 35

Administrator: Kevin | Moderators: Kevin