4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 .htaccess and AuthUserFile line help
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
bluesky
Junior WebHelper
Junior WebHelper


Joined: 26 Sep 2006
Posts: 6

PostPosted: Tue Sep 26, 2006 9:09 pm (9 years, 7 months ago) Reply with QuoteBack to Top

I followed the guide at this to generate an .htaccess and .htpasswd file (great guide btw). I placed the .htaccess and .htpasswd files in /test on my webspace. When I attempt to browse to that dir on my webspace, I am prompted for a username/password, but when I enter them and hit OK, the box just keeps popping up asking again and again.

I can only access the space via FTP.

Here is my .htaccess file:

Code:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /.htpasswd
AuthGroupFile /dev/null
require valid-user


Here is my .htpasswd file:

Code:
user:71wYhs3y.tvIc


I'm thinking the AuthUserFile line in my ./htaccess isn't correct. Do I need to use the absolute UNIX path to my web page home dir? The tech. support at my ISP tells me they have no way of getting that information to me. Is there some way I can get the abs path to make this work, OR is there another way to setup the .htaccess file?

________________________________
http://encoding.n3.net <-- for all your CD and DVD backup needs.
OfflineView User's ProfileFind all posts by blueskySend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564
Location: London, UK

PostPosted: Tue Sep 26, 2006 10:11 pm (9 years, 7 months ago) Reply with QuoteBack to Top

You should be able to use a relative path. If the files are in the same directory, try using
Code:
AuthUserFile .htpasswd
or
Code:
AuthUserFile ./.htpasswd


I'm not 100% sure that'll work though.

If it doesn't, create a .php file with the following contents (assuming of course that your host supports PHP):
Code:
<?php echo $_SERVER['DOCUMENT_ROOT']; ?>


Then visit that page in your browser and you should find the absolute path to your home dir.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Tue Sep 26, 2006 11:27 pm (9 years, 7 months ago) Reply with QuoteBack to Top

I personally would question why the server techs are unable (or perhaps just unwilling) to give you that information. Seems very strange to me.

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
bluesky
Junior WebHelper
Junior WebHelper


Joined: 26 Sep 2006
Posts: 6

PostPosted: Tue Sep 26, 2006 11:55 pm (9 years, 7 months ago) Reply with QuoteBack to Top

Daniel wrote:
You should be able to use a relative path. If the files are in the same directory, try using
Code:
AuthUserFile .htpasswd
or
Code:
AuthUserFile ./.htpasswd


I actually tried that prior to posting... same result.

Daniel wrote:
If it doesn't, create a .php file with the following contents (assuming of course that your host supports PHP):
Code:
<?php echo $_SERVER['DOCUMENT_ROOT']; ?>


Then visit that page in your browser and you should find the absolute path to your home dir.


This is interesting. I made a blank text file with that line as the sole contents. When I browsed to it (http://mysite.com/blank.php) firefox wanted to download "blank.php" ... I must have done that incorrectly or they don't support php?

________________________________
http://encoding.n3.net <-- for all your CD and DVD backup needs.
OfflineView User's ProfileFind all posts by blueskySend Personal Message
bluesky
Junior WebHelper
Junior WebHelper


Joined: 26 Sep 2006
Posts: 6

PostPosted: Wed Sep 27, 2006 12:13 am (9 years, 7 months ago) Reply with QuoteBack to Top

adam wrote:
I personally would question why the server techs are unable (or perhaps just unwilling) to give you that information. Seems very strange to me.


Whenever I call into the tech support department they claim that they have no web server techs; they are outsourcing the webservers to a 3rd party and cannot provide me with the name of the 3rd party. It's starting to get on my nerves... this isn't an off-the-wall request

________________________________
http://encoding.n3.net <-- for all your CD and DVD backup needs.
OfflineView User's ProfileFind all posts by blueskySend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564
Location: London, UK

PostPosted: Wed Sep 27, 2006 6:44 am (9 years, 7 months ago) Reply with QuoteBack to Top

Do they advertise .htaccess/.htpaswd support? If so they have an obligation to provide this information. If not then I think we're out of options... Is it a well known ISP? If so maybe you can find the path somewhere on the web.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
bluesky
Junior WebHelper
Junior WebHelper


Joined: 26 Sep 2006
Posts: 6

PostPosted: Wed Sep 27, 2006 8:18 pm (9 years, 7 months ago) Reply with QuoteBack to Top

They don't advertise this support anywhere that I can find. I have tried googling around for it with the ISP name, webroot or web root. Can you think of a better set of key words to use?

________________________________
http://encoding.n3.net <-- for all your CD and DVD backup needs.
OfflineView User's ProfileFind all posts by blueskySend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564
Location: London, UK

PostPosted: Thu Sep 28, 2006 6:41 am (9 years, 7 months ago) Reply with QuoteBack to Top

You could try "document root" too, or "path AND htaccess AND ISP_name".

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
bluesky
Junior WebHelper
Junior WebHelper


Joined: 26 Sep 2006
Posts: 6

PostPosted: Wed Oct 11, 2006 12:00 am (9 years, 6 months ago) Reply with QuoteBack to Top

FINALLY got it!

Just upload a file to via ftp and it printed the absolute path in the ftp log when the put command started! I must have spen 4+ hours on the phone with their tech morons and all it took was a little serendipity!

________________________________
http://encoding.n3.net <-- for all your CD and DVD backup needs.
OfflineView User's ProfileFind all posts by blueskySend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Wed Oct 11, 2006 7:47 pm (9 years, 6 months ago) Reply with QuoteBack to Top

You should call the techs again and let them know what the path is Very Happy

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.031264 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme