Alrighty, I use the following code to prevent hotlinking:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?serviceacademyforums.com/.*$ [NC]
RewriteRule \.(gif|jpg|js|css)$ - [F]
Now, presently this is in .htaccess, which is located in my _html directory. HOWEVER, I'm going to be doing the whole .htpasswd thing, which requires that .htaccess be moved to the root directory.
HOWEVER, I saw this code:
<Files .htaccess>
order allow,deny
deny from all
</Files> Now, if I put that in the .htaccess that I use to prevent hotlinking, wouldn't that prevent the function of that, and allow hotlinking again, since it can't be read anymore?
If that's the case, would I need a separate .htaccess to link to .htpasswd? IE I'd have an open .htaccess in my _html directory to prevent hotlinking. Then I'd have another one in my root directory pointing to .htpasswd (Unless I can have an open .htaccess and a closed one both in the _html directory).
Alright I'm new to this whole thing, here's what I want to do:
Stop hotlinking (presently .htaccess is in the _html directory)
Use the password protection (presently there's a .htpasswd FOLDER in my root directory, dunno what I should use this for, I guess this is for multiple pw protections).
Here's what I understand I need to do:
Put a .htpasswd file (which I don't know how to create yet with that .extension) in my .htpasswd folder.
Put a .htaccess file SOMEWHERE to protect my PWs, and this will point BACK to .htpasswd. However, where do I put it and do i put that deny access code since it'll (I think) have to go somewhere in the _html directory.
This is a really confusing post, I hope someone can help.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?serviceacademyforums.com/.*$ [NC]
RewriteRule \.(gif|jpg|js|css)$ - [F]
Now, presently this is in .htaccess, which is located in my _html directory. HOWEVER, I'm going to be doing the whole .htpasswd thing, which requires that .htaccess be moved to the root directory.
HOWEVER, I saw this code:
<Files .htaccess>
order allow,deny
deny from all
</Files> Now, if I put that in the .htaccess that I use to prevent hotlinking, wouldn't that prevent the function of that, and allow hotlinking again, since it can't be read anymore?
If that's the case, would I need a separate .htaccess to link to .htpasswd? IE I'd have an open .htaccess in my _html directory to prevent hotlinking. Then I'd have another one in my root directory pointing to .htpasswd (Unless I can have an open .htaccess and a closed one both in the _html directory).
Alright I'm new to this whole thing, here's what I want to do:
Stop hotlinking (presently .htaccess is in the _html directory)
Use the password protection (presently there's a .htpasswd FOLDER in my root directory, dunno what I should use this for, I guess this is for multiple pw protections).
Here's what I understand I need to do:
Put a .htpasswd file (which I don't know how to create yet with that .extension) in my .htpasswd folder.
Put a .htaccess file SOMEWHERE to protect my PWs, and this will point BACK to .htpasswd. However, where do I put it and do i put that deny access code since it'll (I think) have to go somewhere in the _html directory.
This is a really confusing post, I hope someone can help.
Comment