.HTACCESS - One File or Two?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

.HTACCESS - One File or Two?

Postby ozental_uk » 13. April 2005 15:03

Hey there. I'm a little confused about .HTACCESS and hope that you can help me. I have a site that features different directory structures and I have different .HTACCESS files scattered around the site. But I'm wondering, do I need more than one .HTACCESS file?

For example, I have one in:


Code: Select all
<Limit GET>
order allow,deny
allow from all
deny from
deny from anaughty.domain.com

<IfModule mod_rewrite.so>
...various re-write statements go here...

...and one in \htdocs\phpBB\

Code: Select all
DirectoryIndex index.html index.htm portal.php index.php

...and one in \htdocs\phpBB\admin\

Code: Select all
[url]order deny,allow
allow from 666.666.666.666
deny from all[/url]

The first is to block certain sites from accessing any of my site. The second if to provide some index statements for my phpBB2 site. The third is to block anyone by a specified IP from accessing the admin part of my phpBB forum.

But my question is, do I need all of these and is it bad practice to have so many wandering around a site?

Also, is there a heirachy of .HTACCESS files. By this I mean, do all rules and lines mentioned in my \htdocs\.HTACCESS file apply to all sub-folders off of \htdocs\ or do the rules only apply to that directory?
Posts: 21
Joined: 30. July 2004 22:17

Postby Dave_L » 13. April 2005 17:20

From http://httpd.apache.org/docs-2.0/howto/htaccess.html

.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.
User avatar
Posts: 212
Joined: 23. October 2004 00:43

Postby prathapml » 13. April 2005 21:24

I suggest this tutorial for .htaccess :
Posts: 87
Joined: 11. March 2005 23:03

Postby ozental_uk » 14. April 2005 09:47

Posts: 21
Joined: 30. July 2004 22:17

Postby sckoh » 16. April 2005 13:06

Do you know what to do to remove the .htaccess file from hosting server, with ftp browser?
User avatar
Posts: 67
Joined: 01. March 2005 02:16
Location: Washington DC

Postby ozental_uk » 16. April 2005 14:47

I guess that depends how your site is hosted. Certainly you should be albe to do it via FTP if you have the ability to delete files. This is definately the case for any files that you can upload but there may be certain ISP-related directory files that you there from your ISP that you may not be able to delete.
Posts: 21
Joined: 30. July 2004 22:17

Postby prathapml » 16. April 2005 17:33

By ftp _browser_ I dunno what you mean.
But ftp apps do easily delete .htaccess as easily as anything else.
But if you aren't allowed, then you could edit it to blank it out completely.
Posts: 87
Joined: 11. March 2005 23:03

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 65 guests