WordPress.org

Ready to get started?Download WordPress

Forums

Role Scoper
Redirect to a specific WordPress page instead 404 (5 posts)

  1. simbian
    Member
    Posted 1 year ago #

    Hello, im using the plugin and i noticed it works nice, however i ask it's normal that the users that don't have the reading/view privilege about a restricted WordPress page see the 404 page? It's possible to show a specific WordPress page instead?

    Thanks
    Simone

    http://wordpress.org/extend/plugins/role-scoper/

  2. Loc Huu Ho
    Member
    Posted 1 year ago #

    Hi I was wondering about this too. Anyone can give advice on this topic?

  3. simbian
    Member
    Posted 1 year ago #

    Maybe there isn't a solution to fix this?

  4. simbian
    Member
    Posted 1 year ago #

    i tried with this code

    <?php
    	global $wpdb;
    	$post_id = 30;
    	$post_exists = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE id = '" . $post_id . "'", 'ARRAY_A');
    	if($post_exists){
    	  echo 'Sorry, you do not have permission to view this page.';
    	} else {
    	  echo 'Sorry but the page you are looking for cannot be found.';
    	}
    				?>

    but this doesn't solve the problem because it just checks if the post exists and it shows the proper message, anyway the post always exists.

  5. kevinB
    Member
    Plugin Author

    Posted 7 months ago #

    There is no support for redirecting to an arbitrary page, but if you enable Roles > Options > Features > Hidden Content Teaser, you can specify a custom denial message (including html if desired) for each post type.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic