Forum Moderators: phranque

Message Too Old, No Replies

help with my .htaccess file

need explanation on how to read this file

         

ehmweb

10:22 pm on Dec 4, 2004 (gmt 0)



hi all,
Please bear with me since i'm complete new to the forum.
Have beem reading it for about a week and today I subscribe in order to post here.
I have this .htaccess file on my server, above all my other virtual clients (Ihave one main domain and 20 other virtual domains below).
I just whant some one to explain the last 2 lines
AuthUserFile and AuthGroupFile
what it does?
Second question, is I want to add this line at the end of this file:
ErrorDocument 404 [my_server.com...]

to the end of my .htaccess. Can I do it?

I removed the server name, just in case... :(

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName My_Server.com
AuthUserFile /usr/local/etc/httpd/htdocs/_vti_pvt/service.pwd
AuthGroupFile /usr/local/etc/httpd/htdocs/_vti_pvt/service.grp

jdMorgan

1:39 am on Dec 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ehmweb,

Welcome to WebmasterWorld!

The last two lines of your file won't do anything, because there are no other directives in the file that use them.

> I want to add this line at the end of this file:
> ErrorDocument 404 http://www.my_server.com/cgis/404/404.cgi?404
> to the end of my .htaccess. Can I do it?

No, because that code is incorrect, and will result in your server responding with 200-OK status, instead of 404-Not Found. The correct syntax is:


ErrorDocument 404 /cgis/404/404.cgi?404

ErrorDocument needs a local url-path only. Otherwise it will generate a 302-Moved Temporarily redirect, and then a 200-OK status. This can seriously confuse search engine spiders, and lead to loss of your search engine ranking.

For more information on your first question, see the Apache mod_auth docmentation [httpd.apache.org], the AuthName [httpd.apache.org] and AuthType [httpd.apache.org] directives, as well as the Apache authentication and authorization tutorial [httpd.apache.org].

Note: Even if you don't use password-protection right now, be sure to write down the local paths specified in those two directives before deleting them -- You may need that information later, should you wish to password-protect a directory.

For more information on ErrorDocument, see the Apache core ErrorDocument documentation [httpd.apache.org]. Note especially the warning about supplying a full URL.

Jim