Archive for the 'Htaccess' Category

Quick method for adding multiple usernames and password to htaccess

Monday, December 11th, 2006

Ever had to add hundreds or even thousands of usernames to a htaccess file at once? Although rare this problem has come up for me recently (strangely enough with the same password as the username - obviously not a secure method but something that was necessary for the project).

The solution I created for this problem is htpmake, essentially a PHP script that takes a text file and outputs a file that of usernames and passwords you can use with your htaccess file.

(more…)

IP ban or redirection

Tuesday, May 30th, 2006

My previous post dealt with people hot linking to images on your website. This tutorial explains how to block users by IP or by domain from reaching your site as well as preventing other people to access your files from their site. Once again the Apache module mod_rewrite must be on for the second section of this tutorial to work.

Once again this tutorial contains a number of htaccess samples. If you are unsure about how htaccess works, then try reading the article on WikiPedia before using the contents of this tutorial.

(more…)

Stop the hot-linkers

Monday, May 29th, 2006

The purpose of this tutorial is to show you how to stop people using images hosted on your domain within their own websites.

You can use the information in this tutorial to force hot linked images to be redirected to another image to dub the person a lecher. This, however, does not save you bandwidth since an image is still being pulled from your server.

All of the code below goes into .htaccess on your server (this is a system file and is set to be hidden, if you can’t view it then check your FTP client settings). If you are experiencing problems with these scripts, then please insure that mod_rewrite is enabled.

(more…)