Jump to content

Recommended Posts

Lo all,

 

I am doing some ip[ logging using an image. And it requires a .htaccess file to work, which is below (and works fine):

 

AuthUserFile /dev/null
AuthGroupFile /dev/null

RewriteEngine On
ReWriteRule .*\.(jpg|gif)$ http://www.mysite.com/mypage/visitorlog.php [R,L]

 

I have decided now that I want to give just that folder a password to block prying eyes. So I made this alteration (I'll leave out the .htpasswd file code since I know it's ok):

 

AuthUserFile /home/www/mysite.com/mypage/.dhjpofh
AuthType Basic
AuthName "Hi There"
Require valid-user
AuthGroupFile /dev/null

RewriteEngine On
ReWriteRule .*\.(jpg|gif)$ http://www.mysite.com/mypage/visitorlog.php [R,L]

 

 

Now the problem I ran into, is that the gif image that originally worked with the first htaccess code, that kicks off the entire logging process, is now a broken image using the new code, so the logging no longer happens. I am no wizard with the .htaccess stuff so i figure it's probably something simple, but I need the help of the pro's.

 

All help much appreciated. =)

 

Link to comment
https://forums.phpfreaks.com/topic/81249-some-help-whtaccess-htpasswd-pls/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.