Forum Moderators: phranque
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
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
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