Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess is ignored ??

Status
Not open for further replies.

roeiboot

Technical User
Feb 10, 2002
241
US
oi,

i made a sub-dir in the root of the html-dir, created a .htaccess plus a htpasswd.. sofar so good. now when
i browse to that 'page' apache doesn't ask for username and/or password, it right away comes with a 403 error (Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected)

it is a sub-dir without a index, there a just a bunch of jpg's in that folder.. do i need to make adjustments in the httpd.conf file ??

thanks in advance,
rb.
 
Have you edited your httpd.conf file to read like this?:

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride Authconfig

Also, just create a sample index.htm page anyway to have a target. But without one, you should get a list of the .jpgs by default.
 
hi,

yeah, well it said "AllowOverride Authconfig Limit" but i changed it without succes, meaning it's still ignoring the .htaccess file, @ least that's what it looks like..
could it have anything to do with the fact that it's a sub-domain of the main-domain (sub-domain i mean virtual host)

thanks for your prompt reply.!
 
I think then that you must make sure that you have an Alias set correctly in the virtual host, perhaps duplicating your .htaccess lines there. You could try using the alias in the AuthUserFile line of the .htaccess file, or try the literal path - see which one works. Ifincham and Wullie seem to be able to provide the most accurate and concise help on this subject.
 
Hi mate,

Have you checked your error logs?

If not, set your httpd.conf to debug for the logs, try to access the folder again then take a look at your logs..

If this does not provide any help, are you sure the syntax is correct for the htpasswd and the paths are correct..

Also, are you on Unix or Windows?

Hope this helps Wullie

 
Hi,

You can try it with a <Directory> block instead of .htaccess to see if that makes a difference :

<Directory /whatever>
AuthName &quot;Whatever U like&quot;
AuthType Basic
AuthUserFile /var/ require valid-user
</Directory>

Although its basically the same, it should a least tell you whether the problem is the .htaccess file .

Another diagnostic is to put a junk statement in your .htaccess file and see if it generates an 'Internal Server Error' (should do).

Hope this helps
 
oi,

it now works on my main-domain.. (only thing i did was changed the log-level from 'warn' -> &quot;debug'.. on the so-called sub-domain i get tgis error:

--
[Mon Mar 18 09:45:29 2002] [error] [client 192.168.1.1] Directory index forbidden by rule: D:/path/path2/path3/pics
--

i don't understand..

 
Hi,

Thats presuambly because there is a :

Options NoIndexes

or

Options -Indexes

.. in the .htaccess file, <Directory> container, or otherwise in effect somewhere at a parent level above the actual D:/path/path2/path3/pics directory .

Regards
 
i don't think i really understand :} this is the .htaccess-file:

AuthName &quot;Name&quot;
AuthUserFile d:\path\path2\path3\.htpasswd
AuthType Basic
<Limit GET POST PUT>
require user name1 name2
</Limit>

in the httpd.conf file it says:

Options Indexes FollowSymLinks
AllowOverride AuthConfig


 
there is some progress :} i now do get the login-prompt.. but after i enter the correct username & pw (100% sure :) it returns with a 403 error (Access forbidden)

 
too bad.. it doesn't help, it still says the directory is read-protected or there is no index-file. if i enter the url complete with a .JPG that is in that dir it shows..
so it looks like it's dir/folder related, which i don't understand.. aargh :)
 
oi,

tried it with a index.html in that dir/folder.. & then it works, that's weird 'cuz the other protected folder does work without a index.html, plus i don't want a index.html.. i just want to list files..

thanks sofar!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top