Forum Moderators: coopster

Message Too Old, No Replies

Prevent URL Access

         

almo136

5:57 pm on Jun 17, 2009 (gmt 0)

10+ Year Member



Hi,

I am using a plugin in wordpress which redirects users who try to access [mysite.com...]

This line is take from the code:

if (strpos(strtolower($_SERVER['REQUEST_URI']),'/wp-admin/') !== false) {

The plugin works in that it redirects users who try to access [mysite.com...] but they can still access pages under that folder but putting the full url in the address bar ie:

[mysite.com...]

Does anyone know how I would edit the above line to prevent access to wp-admin and everything below it?

Thanks!

jatar_k

6:04 pm on Jun 17, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



a better way to secure it would be to use htpasswd [google.com]

almo136

6:11 pm on Jun 17, 2009 (gmt 0)

10+ Year Member



I tried that but it then messed up the ability for users to edit posts in the front-end (using another plugin).

It's not critical that they can't access the admin area as their options are pretty limited once they get there.

I'd just prefer it if they couldn't.

jatar_k

6:13 pm on Jun 17, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I assume you would just add it to each page but wouldn't that also "mess up the ability for users to edit posts in the front-end"?

almo136

6:33 pm on Jun 17, 2009 (gmt 0)

10+ Year Member



yep, you're right. It does.

Thanks.