DotDragnet
May 24, 2012, 04:44:57 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: follow us on twitter @dotdragnet
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Wordpress access by IP  (Read 575 times)
Matt
DDN Contribs
Hero Member
*****
Posts: 1710



View Profile WWW Awards
« on: May 25, 2011, 01:59:11 PM »

I would like to block users from visiting a page and its child pages unless they are from an internal IP range (IE: so I can control what they see in school and at home in terms of a wordpress site)

I can create a custom page template, so if some simple PHP would do it then I can do that, and set each page with the custom page template.

Any ideas? Otherwise Im going to have to create two separate sites sharing the same database.
Logged

Jem
Sr. Member
****
Posts: 469



jemjabella jemjabella
View Profile WWW Awards
« Reply #1 on: May 25, 2011, 03:00:23 PM »

One of the user management plugins allows blocking by IP - I was fiddling with it the other day. Unfortunately I can't remember which one it was. Sorry to be absolutely useless, but at least you now know the functionality is there...
Logged

oi.
suedenem
Sr. Member
****
Posts: 410



View Profile Awards
« Reply #2 on: May 25, 2011, 03:12:34 PM »

Htaccess:

order allow,deny
allow from 123.
deny from all

...would allow access from the 123.xxx... range.  

You should be able to use the 'files' directive if you're using 'permalinks' and don't want to manually create the directories.
Logged

So this SEO copywriter walks into a bar, grill, pub, public house, Irish bar, bartender, drinks, beer, wine, liquor...

Beware my weird, cross-dressing comment's; they are pretty standard examples of trolling.
Matt
DDN Contribs
Hero Member
*****
Posts: 1710



View Profile WWW Awards
« Reply #3 on: May 25, 2011, 03:40:06 PM »

Htaccess:

order allow,deny
allow from 123.
deny from all

...would allow access from the 123.xxx... range.  

You should be able to use the 'files' directive if you're using 'permalinks' and don't want to manually create the directories.

Hmm, this sounds like a plan, having never used this kind of thing have you got a link to a more in depth introduction to it? What is the 'files' directive?
THanks!
Logged

JasonD
Global Moderator
Hero Member
*****
Posts: 551



View Profile Awards
« Reply #4 on: May 25, 2011, 10:17:12 PM »

http://httpd.apache.org/docs/2.2/mod/core.html#files

But doesn't wordpress direct everything through one file? (Haven't used it in a million years, I may be wrong.) If so that wouldn't be a lot of use.
Logged
Matt
DDN Contribs
Hero Member
*****
Posts: 1710



View Profile WWW Awards
« Reply #5 on: May 26, 2011, 08:08:26 AM »

http://httpd.apache.org/docs/2.2/mod/core.html#files

But doesn't wordpress direct everything through one file? (Haven't used it in a million years, I may be wrong.) If so that wouldn't be a lot of use.


Think it all goes through index.php
Logged

Matt
DDN Contribs
Hero Member
*****
Posts: 1710



View Profile WWW Awards
« Reply #6 on: May 26, 2011, 10:06:33 AM »

http://wordpress.org/extend/plugins/intranet-restriction-for-posts-and-pages/

This plugin, and ensuring I was putting in the right IPs based on our proxy details etc worked smile
Logged

suedenem
Sr. Member
****
Posts: 410



View Profile Awards
« Reply #7 on: May 27, 2011, 09:08:58 AM »

http://httpd.apache.org/docs/2.2/mod/core.html#files

But doesn't wordpress direct everything through one file? (Haven't used it in a million years, I may be wrong.) If so that wouldn't be a lot of use.


Note to self: either engage brain or don't post between tasks ;-)

I'd still use .htaccess personally (I'm not a fan of bolting on who-knows-what code into my sites unless it's been properly evaluated).  A simple rewrite based on permitted IP range(s) and URL structure that the OP would like blocking would do the job.
Logged

So this SEO copywriter walks into a bar, grill, pub, public house, Irish bar, bartender, drinks, beer, wine, liquor...

Beware my weird, cross-dressing comment's; they are pretty standard examples of trolling.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!