homepage Welcome to WebmasterWorld Guest from 23.20.44.136
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Visit PubCon.com
Home / Forums Index / Search Engines / Sitemaps, Meta Data, and robots.txt
Forum Library, Charter, Moderators: goodroi

Sitemaps, Meta Data, and robots.txt Forum

    
should the file .htaccess visible
newbies




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

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




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

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




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

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




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

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




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

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




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

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




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Search Engines / Sitemaps, Meta Data, and robots.txt
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved