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 problem 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I've set up password protection on a directory of my site using .htaccess.

The password protection seems to be working ok. Users are propted to enter username/password upon requesting the directory. Everything is fine there.

The problem is, users are asked again and again to authenticate when using the links on the site. I have no idea why.

For context, the index page in the directory is a simple .html page with links to downloadable .pdf and .xls files in a subdirectory.

Any advice would be greatly appreciated.

Thanks.
 
Thanks for the fast reply.

The contents of my .htaccess are below, with SITENAME/DIRECTORY and USERNAME substituted.

AuthUserFile /export/nfs/cust/6/0/1/SITENAME/DIRECTORY/.htpasswd
AuthGroupFile /dev/null
AuthName Authentication
AuthType Basic

<Limit GET>
require user USERNAME
</Limit>

As for my httpd.conf, I do not have access to my hosting provider's shell. So I can't get at that file, right?

Is that potentially the problem?

Thanks again.
 
Hi mate,

This is just a suggestion and may or may not work..

Try using the following:

AuthUserFile /export/nfs/cust/6/0/1/SITENAME/DIRECTORY/.htpasswd
AuthGroupFile /dev/null
AuthName &quot;Authentication&quot;
AuthType Basic

<Limit GET>
require user USERNAME
</Limit>
Wullie

 
We've had a similar issue and solved it this way.

The page with the dowload links is proteced as you did it.
The directory where the download files reside is proteced with a &quot;SetEnvIfNoCase Referer .\our-domain\.com&quot; statement (please look up in the Apache doc for fruther information: ).
This allows access to the files only for user agents with a valid referer from your domain. Maybe you could also write something like &quot;\.our-domain\.com/proteced-download-page.htm&quot;

HTH, Sascha cu, Sascha
 
Wullie,

Unfortunately, this did not solve the problem. I attempted it, but the multiple prompts persist.

Thanks for your help.
 
Accoding to clever.net...

The .htaccess file affects the directory in which it is placed, so any visitor requesting <URL: would be presented with an authentication request.

The .htaccess file also affects directories recursively below it. Therefore, requesting <URL: would yeild the same authentication request unless ~/somepath/evenmore had a .htaccess file of its own.


As a novice, I'm now struggling with what the .htaccess in the subdirectory should include so as not to prompt the user for aurthentication.
 
Try this one for the subdirectorys.

Order deny,allow
Allow from localhost

If it fails, try this

Order allow,deny
Allow from all

HTH cu, Sascha
 
Hi mate,

htaccess must not be placed in a subdirectory of a protected area unless you require different login details for that subdirectory..

When you place a htaccess file in a directory, all subdirectories are automatically protected..

Just include a htaccess in the highest directory that you want to protect only..

Hope this helps Wullie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top