• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Tag Archives: Wordpress Mu

WordPress MU: Limit access to certain blogs

July 2, 2009 3:22 pm / Albertech.net

I recently implemented a way to limit access by IP range on specific blogs on WordPress MU. As you know, WordPress MU uses Apache Rewrite engine to rewrite URLs. For instance, you have a blog on WordPress MU called “intranet”. Apache Rewrite takes the “intranet” string in the URL and automatically rewrites it as a value in the PHP script. A side effect to Apache Rewrite is that “Directory” .htaccess parameters don’t work. So, if you wanted only your company IPs to access an internal blog, you will need to use Apache Rewrite parameters instead.

Here’s how to limit access to an IP or subnet on a particular blog on your WordPress MU install:

DISCLAIMER: Modifying .htaccess files can break your WordPress MU install. ALWAYS backup your .htaccess file. Simply, copy .htaccess file and rename it to .htaccess-backup. (cp .htaccess .htaccess-backup)

Step 1:

Add a section after the “RewriteEngine On
RewriteBase /…” section

RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.5
RewriteCond %{REQUEST_URI} ^/BLOG1
RewriteRule .* - [F]

DO NOT SAVE YET. You will need edit the IP address info and blog info first:

Step 2: Replace the 1.2.3.4 number with your company IPs (its easier if you have an entire subnet or you can use internal IPs)

For a class C, the part after {REMOTE ADDR} would be
!^1\.2\3\.

Step 3: Replace BLOG1 with the blog you want to limit access to those IPs. So http://www.mysite.com/myfirstblog would be “^/blogs/

Optional: If you have WordPressMU installed in a folder (e.g. not your root folder), you will need to append the directory in front of the blog name.

For instance, if you have http://mysite.com/blog (as your WordPress MU root folder) the ^/ BLOG1 would be

^/blog/BLOG1

Optional: Multiple blogs with same access restrictions
By default, the Apache Rewrite treats every line as an AND statement. If you have multiple blogs, you will need to have an [OR] at the end of the line.

RewriteCond %{REQUEST_URI} ^/BLOG1 [OR]
RewriteCond %{REQUEST_URI} ^/BLOG2

Errors?

  • Make sure you have ^/ marks in front of the blog names
  • IP addresses must have a backslash before each dot. Regular expression for dot is concatenate by default, so it needs to be escaped
  • Make sure you don’t forget the !^ sign before the IP, otherwise you will be forbidden.

If all else fails, if can’t fix the error, just copy back the .htaccess-backup to the .htaccess file.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Apache, Linux, PHP / Tagged: limit access, wordpress mu

WordCamp SF 2009

June 3, 2009 3:04 pm / Albertech.net

 
I attended WordCamp SF for the first time in 2009. There was some exciting news at the camp, especially with the news that WordPress MU functionality is going to get integrated with WordPress. This will be nice considering updates for WordPress MU are usually a month or so behind. What will this mean? Hopefully, it will bring a larger community in maintaining and adding new plugins for WordPress (MU).  The question will be whether it will be easy to convert an existing WordPress MU install over to the new WordPress. (Possibly WordPress 3.0?)

Highlights of the conference:
Timothy Ferriss
, nominated as one of Fast Company’s “Most Innovative Business People of 2007,” is an angel investor and author of the #1 New York Times, Wall Street Journal, and BusinessWeek bestseller, The 4-Hour Workweek, which has been sold into 35 languages. He had a lot of good points on tweaking blogs to reach a larger audience.

WordPress gear! I plan on sending out some stickers and buttons I got at the conference.. stay tuned.

BuddyPress There’s a lot of potential with the community aspect of blogs. I’m hoping this functionality will be integrated with WordPress MU.

Community Speakers and Authors: http://2009.sf.wordcamp.org/speakers/#chris Chris Pirillo is an excellent speaker, had a lot of interesting points about the importance of the community.

http://2009.sf.wordcamp.org/speakers/#tara Tara Hunt’s book about the value of building community vs. buying a community.

http://2009.sf.wordcamp.org/speakers/#cali Cali Lewis (GeekBrief.TV) talked about building an interactive audience. Learned a lot about the challenges of video vs. audio cast.

Last but not least, the community! It was great meeting everyone at the after party.

More info about the upcoming merge with WordPress MU and WordPress (see the comments below the post)
http://technosailor.com/2009/05/30/wordcamp-sf-announcement-wordpress-and-wordpress-mu-to-merge/

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: CMS, PHP / Tagged: wordcamp, wordpress mu

WordPress MU: Add private blogs

April 21, 2009 12:40 pm / Albertech.net

I have found a really useful plugin in WordPress MU for making a blog private. Sometimes, committees need a way to share information away from home and they don’t want everything posted to be known by the world. Rather than using the “Password protect post” option, there is a way to only allow registered users that are members of the blog to view the post.

By default, the privacy options in WordPress MU is limited to 1) Public, allow search engines 2) Public, don’t allow search engines.

http://wpmudev.org/project/More-Privacy-Options

This plugin adds functionality:
3) I would like my blog to be visible only to registered users from blog community
4) I would like my blog to be visible to registered members of this blog
5) I would like my blog to be visible only to administrators

To install:
1) Download the plugin file.
2) Copy the plugin file to the plugin folder in WordPress MU
3) In the Plugin interface in WordPress MU, activate the “More Privacy Options” Plugin
4) In the Privacy option of the blog (under Settings -> Privacy) you will have the additional privacy options. Select the “I would like my blog to be visible to registered members of this blog
I would like my blog to be visible to registered members of this blog” option.
5) Note: AFAIK, this is on a site by site basis, so will need to enable this plugin for each blog you want to add it to.

Update 4/28/2010:
If you upgrade WordPress MU to a newer version, you will need to set the “Privacy Settings” again. Occasionally, the WordPress upgrade will reset the privacy settings back to default.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: CMS, PHP / Tagged: plugin, privacy, private blog, wordpress mu

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.