Comments on: How to create an .htaccess file http://www.tomrafteryit.net/creating-an-htaccess-file/ Tom Raftery, social media consultant, speaker, blogger and podcaster Tue, 24 Feb 2009 18:51:20 +0000 http://wordpress.org/?v=2.7 hourly 1 By: Haley http://www.tomrafteryit.net/creating-an-htaccess-file/comment-page-1/#comment-116163 Haley Fri, 18 Apr 2008 01:29:07 +0000 http://www.tomrafteryit.net/views/?p=123#comment-116163 I have a question regarding setting up an .htaccess file . I am trying to allow access to a directory based on the referrer being the following: http://www.example.com/somedirectory/home.php I have .pdf files and .doc files as well as .php and .html files in another directory http://www.example.com/directory2/example.doc /directory2/ example.doc page.pdf index.html page.php I only want the directories under directory2 to be served to the client if the referrer comes from only the one single above page in my domain. And if this is not the case, redirect the user to the following page: http://www.example.com/access_error.php How do I construct the .htaccess file so that this will work under Apache Tomcat?? I have been researching this for many days now, and need it for a project I'm doing. I know it's something small and silly, I just can't figure it out, and I want to be able to copy the .htaccess to other directories, and add it to new directories down the road. So the .htaccess file needs to only effect the directory it's in. Any help would be greatly appreciated. Sincerely, Haley Miska Web Programmer I have a question regarding setting up an .htaccess file . I am trying to allow access to a directory based on the referrer being the following:

http://www.example.com/somedirectory/home.php

I have .pdf files and .doc files as well as .php and .html files in another directory

http://www.example.com/directory2/example.doc

/directory2/
example.doc
page.pdf
index.html
page.php

I only want the directories under directory2 to be served to the client if the referrer comes from only the one single above page in my domain. And if this is not the case, redirect the user to the following page:

http://www.example.com/access_error.php

How do I construct the .htaccess file so that this will work under Apache Tomcat?? I have been researching this for many days now, and need it for a project I’m doing. I know it’s something small and silly, I just can’t figure it out, and I want to be able to copy the .htaccess to other directories, and add it to new directories down the road. So the .htaccess file needs to only effect the directory it’s in. Any help would be greatly appreciated.

Sincerely,
Haley Miska
Web Programmer

]]>
By: Jan from Igloo http://www.tomrafteryit.net/creating-an-htaccess-file/comment-page-1/#comment-110417 Jan from Igloo Thu, 06 Sep 2007 10:39:48 +0000 http://www.tomrafteryit.net/views/?p=123#comment-110417 Simple question, a little off-topic, but anyway ... Is it possible to use .htpasswd and .htaccess without having SSH access to the server? Or another words: Is it possible to protect your folders with passwords without having any SSH access? I have been trying to find something on this topic (because I wanted to protect few folders on my site), but I wasn't able to solve this problem properly... So now I am using .htaccess only (IP: deny, allow). Simple question, a little off-topic, but anyway … Is it possible to use .htpasswd and .htaccess without having SSH access to the server? Or another words: Is it possible to protect your folders with passwords without having any SSH access?

I have been trying to find something on this topic (because I wanted to protect few folders on my site), but I wasn’t able to solve this problem properly… So now I am using .htaccess only (IP: deny, allow).

]]>
By: Using .htaccess to stop remote image linking (hotlinking) and bandwidth theft » at Tom Raftery’s I.T. views http://www.tomrafteryit.net/creating-an-htaccess-file/comment-page-1/#comment-6479 Using .htaccess to stop remote image linking (hotlinking) and bandwidth theft » at Tom Raftery’s I.T. views Thu, 16 Mar 2006 18:41:42 +0000 http://www.tomrafteryit.net/views/?p=123#comment-6479 [...] The most straightforward is to simply create an .htaccess file with the following code: [...] [...] The most straightforward is to simply create an .htaccess file with the following code: [...]

]]>
By: Using .htaccess to minimise comment and referrer spam « Tom Raftery’s I.T. views http://www.tomrafteryit.net/creating-an-htaccess-file/comment-page-1/#comment-2310 Using .htaccess to minimise comment and referrer spam « Tom Raftery’s I.T. views Thu, 03 Nov 2005 11:09:46 +0000 http://www.tomrafteryit.net/views/?p=123#comment-2310 [...] IMPORTANT WARNING: the .htaccess file is a very unforgiving file. It has the power to make your entire site unavailable to anyone. It is strongly advised to read up on Regular Expressions and Mod_Rewrite (the Apache module which processes these commands in a .htaccess file) before creating a .htaccess file or modifying an existing one. [...] [...] IMPORTANT WARNING: the .htaccess file is a very unforgiving file. It has the power to make your entire site unavailable to anyone. It is strongly advised to read up on Regular Expressions and Mod_Rewrite (the Apache module which processes these commands in a .htaccess file) before creating a .htaccess file or modifying an existing one. [...]

]]>
By: Tom Raftery’s I.T. ramblings » Using .htaccess to minimise comment and referrer spam http://www.tomrafteryit.net/creating-an-htaccess-file/comment-page-1/#comment-483 Tom Raftery’s I.T. ramblings » Using .htaccess to minimise comment and referrer spam Sat, 12 Feb 2005 11:25:07 +0000 http://www.tomrafteryit.net/views/?p=123#comment-483 [...] Mod_Rewrite (the Apache module which processes these commands in a .htaccess file) before creating a .htaccess file or modifying an existing one. [...] [...] Mod_Rewrite (the Apache module which processes these commands in a .htaccess file) before creating a .htaccess file or modifying an existing one.

[...]

]]>