PDA

View Full Version : What and how do I code the .htaccess?


magr
01-10-2004, 07:07 PM
A folder in my site is being accessed without permission by another site and bandwidth is being used. It is open to others to reference by everybody and linked to with permission only.

I am not learned on doing much in the CNC. I read about possibly using the .htaccess to allow or disallow a site from accessing.

Right now, I have a blank .htaccess txt file that I placed in the folder. I do not know what to type in to make it functional.

I would appreciate if someone can walk me through the process or if there is a better way to stop the access to the unauthorized site.

Thank you very much.

hobbes
01-11-2004, 06:54 AM
Following is FQ's tutorial on password protecting part of your site:
http://www.aota.net/htaccess/pwprotect.php4

magr
01-11-2004, 09:07 AM
It is not feasible to password protect this folder with close to 300 files because it is open to the public for reference to print or view. The other site links to most of the files to add to their info page.

Thanks for the reply.

Bob
01-11-2004, 09:14 AM
Hello,

If you can ascertain the IP address of the other site you should be able to simply add a .htaccess "Deny from" directive...
http://www.aota.net/forums/showthread.php?postid=92333#post92333

-Bob

magr
01-11-2004, 10:32 AM
Hi Bob,

Is this possible for a web address?

Thanks for the reply!

Bob
01-11-2004, 11:08 AM
Hi again,

I am not sure if using a domain name would be as effective as using the IP address as most examples I have seen and used were based on IP address...

However from documentation it appears that blocking based on domain name is also supported and it may be prudent to block both the IP and the domain...
http://httpd.apache.org/docs/mod/mod_access.html#deny
http://httpd.apache.org/docs/mod/mod_access.html#allow

To determine the IP for a domain simply ping the domain name and see what IP it resolves to.

- Bob

magr
01-11-2004, 12:12 PM
Thank you, Bob!