DNN Blog

Oct 11

Posted by: Chris Hammond
10/11/2011 12:11 AM  RssIcon

Have you ever had the need to blog a range of IP Addresses from accessing your website? Or perhaps, setup a website that is only accessible to a specific range of IP Addresses? DotNetNuke Request Filters are a great tool for getting such functionality configured, all configurable within your browser, without needing access to the settings in IIS.

Before configuring the request filters, I’ll throw out an example of why you might do this. If your website has a forum, or other community type interface, you have likely experienced spammers trying to take advantage of these features. Sometimes these spammers come from a specific IP Address, or even a specific range of ip addresses. If that is the case, you may want to turn off your website for those IP Addresses.

A word of warning, the instructions below are very powerful, if you aren’t careful, you could bring your website down. Read through the instructions before attempting to configure your website’s request filters.

Configuring your DotNetNuke website to be accessible from one IP Address

Here are the steps to configure request filtering for an IP Address, essentially making the website ONLY accessible to a person browsing from a computer using the defined IP address. All other addresses will redirect to DotNetNuke.com. (these instructions assume you are running on DotNetNuke 6+

  1. Login to your website with a Super User account (typically HOST).
  2. Navigate to the Host/Host Settings page.
  3. From there click on the Other Settings tab
  4. Check the Enable Request Filters checkbox image
  5. Click on Add New Rule image
  6. First we will configure the site to only be accessible from a specific IP Address (67.188.123.23). These settings configure all requests not from 67.188.123.23 to redirect to DotNetNuke.com image
  7. To SAVE your new rule, click on the disk icon to the left of the Server Variable field.
  8. If you access the site from the IP Address defined above, the site would function as normal.
  9. If you access the site from a different IP Address than the one defined above, you would be redirected to DotNetNuke.com

Configuring your DotNetNuke website to NOT be accessible from a range of IP Addresses

  1. Login to your website with a Super User account (typically HOST).
  2. Navigate to the Host/Host Settings page.
  3. From there click on the Other Settings tab
  4. Check the Enable Request Filters checkbox image
  5. Click on Add New Rule image
  6. First we will configure the site to NOT be accessible from a specific IP Address range (67.188.1.1-254). These settings configure all requests from this range to redirect to DotNetNuke.com, all other requests would access the site as normal. image
  7. To SAVE your new rule, click on the disk icon to the left of the Server Variable field.
  8. If you access the site from the IP Address in the range defined above, the site would redirect.
  9. If you access the site from a different IP Address than the range defined above, the site would function as normal.

If you are having trouble generating the proper regular expression for a Range of IP Addresses you can check out this page on Google Answers.

If you happen to screw up a rule, and make your site inaccessible, if you can access the file system (either via the server, or FTP) you can find the rules defined in the dotnetnuke.config file in the root of your website.

Be careful if you play around with request filters! They can be very powerful tools.

3 comment(s) so far...


Gravatar

Re: Using request filters in DotNetNuke to restrict website access

This is a great feature that is often overlooked. Nice tutorial!

By Will Morgenweck on   10/11/2011 8:33 AM
Gravatar

Re: Using request filters in DotNetNuke to restrict website access

Thanks for the heads up Chris! This is a very handy feature.

By Greg Brown on   10/11/2011 4:26 PM
Gravatar

Re: Using request filters in DotNetNuke to restrict website access

Cool. This is great for limiting access to website during testing period.

By Fuji Nguyen on   10/12/2011 2:42 PM
Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me
Charlotte DoDNN

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

DotNetNuke DNN Hosting
Exact Target Exec Alert
r2integrated

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.