I only want users to be able to use the dashboard of my WordPress site. I have a custom login form on the homepage but apart from that I don’t want them to be able to access anything else on the front end.
I have seen the following htaccess fule…
# BEGIN redirect to homepage
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js|php)$
RewriteCond %{REQUEST_URI} !^/wp-admin [NC]
RewriteRule .* / [L,R=301]
#END redirect to homepage
Which looks like it would do what I need, but is there a better way to achieve it?