.htaccess redirect based on user role
-
I’m trying to redirect certain users without the correct role to the login page. Currently I’ve gotten it to work with basic “wordpress_logged_in” from the cookie:
RewriteCond %{REQUEST_URI} ^.*staging/.* RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] RewriteRule . /wp-login.php?redirect_to=%{REQUEST_URI} [R,L]
I would like to find the current user’s role, so I can filter based on this role. Is this possible? Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘.htaccess redirect based on user role’ is closed to new replies.