Welcome to WebmasterWorld Guest from 50.19.53.104

Forum Moderators: goodroi

Message Too Old, No Replies

should the file .htaccess visible

     

newbies

5:45 pm on Feb 26, 2004 (gmt 0)

10+ Year Member



I just created a .htaccess in my root directory and I can load it in my browser. Is this normal, if not, how can I hide it?

Thank you.

BarkerJr

2:34 am on Feb 27, 2004 (gmt 0)

10+ Year Member



Does the .htaccess file work as desired in other ways? If not, maybe your server doesn't support .htaccess.

If it does work as expected, the following lines should be placed in the server's httpd.conf:

<Files ~ "^\.ht"> 
Order allow,deny
Deny from all
Satisfy All
</Files>

jdMorgan

3:58 am on Feb 27, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



That "Satisfy all" in the code may cause problems - it affects authentication (password-protected directories) and is not needed for the problem at hand. I'd leave it out, myself.

Jim

newbies

4:05 am on Feb 27, 2004 (gmt 0)

10+ Year Member



Hi Thanks for reply.

I have something like this in my http.conf file

#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess

<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>

And I have this in my .htaccess file which is in the root directory chmoded to 666. (for use with trap.pl to trap bad robots )

<Files ~ "^.*$">
order allow,deny
allow from all
deny from env=ban
</Files>

Don't know why it can be viewable in browser.

jdMorgan

4:17 am on Feb 27, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Because you probably have AllowOverrides FileInfo set, allowing .htaccess to override your configuration setting.

As a work-around, you could simply add

 SetEnvIf Request_URI "^\.ht" ban 

above your existing .htaccess code

Jim

newbies

3:24 am on Feb 28, 2004 (gmt 0)

10+ Year Member



Thank you for replies. Now it works. However I noticed a little bit slow (like one second waiting) loading my home page after I created the htaccess file which has only several lines.

jdMorgan

3:44 am on Feb 28, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The code above, modified as described, should not slow your server down in the least. Perhaps you have some other code that is causing a redirect loop?

I have one .htaccess file that is almost 30kB in size, and it does not slow down the server noticeably.

If your .htaccess file is slowing down your server, it would be a good idea to remove it until you can test to find out what is wrong -- usually late at night when your traffic drops off, if it does drop off.

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month