Forum Moderators: mack
I've successfully used .htaccess to hide folder directories so I know the procedure for creation, upload and permissions. I don't have any .htaccess files higher up in my directory.
Any ideas?
Thanks,
Nirman
Bravenet does not use one single IP. Rather, they seem to be using any IP in this range:
65.39.176.0 - 65.39.176.255
This should do the trick:
<Files ~ "very-secret-file\.html">
Order Allow,Deny
Allow from 65.39.176
</Files> - at least i should think so ;)
/claus
<edit>Just replace "very-secret-file\.html" with your file name. The "\" should be used before any "." in the file name</edit>
<edit2>oh... and you might also want to give your own IP access (if you have a fixed ip) just make an "Allow from" line under the one that is already there and type your full IP after it </edit2>
Still no access from the bravenet password gate (URL-http://pub19.bravenet.com/passwd/show.php)
the file is getting an alert:
Forbidden
You don't have permission to access /KC/hidden/digialbum.html on this server.
Here's what I used for the .htaccess file:
<Files ~ "digialbum\.html">
Order Allow,Deny
Allow from 65.39.176
</Files>
How do I find the IP number? Is it easy?
Thanks,
Nirman
Then you need to make a "DNS Lookup" - there are quite a few tools for that, i personally like this one: [dnsstuff.com...] (although it seems quite complicated at first sight)
The host name pub19.bravenet.com points to another host which is called public19.bravenet.com, which, in turn, has an IP of:
65.39.176.119
If You want this IP to be able to access the file you specified, you can write:
<Files ~ "digialbum\.html">
Order Allow,Deny
Allow from 65.39.176.119
</Files>
or
<Files digialbum.html>
Order Allow,Deny
Allow from 65.39.176.119
</Files>
Both should work in this case, meaning: "if you come from 65.39.176.119 you can view the file 'digialbum.html' otherwise you can not view this file".
Everybody else will get the message:
"Forbidden
You don't have permission to access ..."
You could try placing the .htaccess file in the directory "/KC/hidden/" but this should not be necessary.
One more thing: delete trailing spaces after the lines if you copy and paste, this sometimes can give errors.
/claus
<edit>added some and deleted it again..hmm...</edit>
If it's enabled, try searching the WW forum for these terms: "htaccess" "htpasswd" "access restriction" - it's sometimes better to use google and limit the search using "site:www.webmasterworld.com"
Anyway, i discovered what is wrong. The bravenet IP is not calling you at all. In stead, the url you gave above just displays your page in a frame using HTML-code like this:
<frame src="something.php?usernum=xxxxxxxxx&id=yyyyyy" frameborder="0" border="0" framespacing="0"> That means that the IP can not be used here. In stead you must use the referer. It's a little more complicated, but try this in your .htaccess in stead:
SetEnvIf Referer ^http://pub(lic)?19.bravenet\.com/passwd/show\.php$ yes<Files ~ "digialbum\.html">
Order Allow,Deny
allow from env=yes
</Files>
This code requires that your server is configured to accept the "SetEnvIf" commands. Your hosting co will know about it, so if it doesn't work, ask them.
Explanation:
The code says that, if the calling page is the one you specified (hostname being either "pub19" or "public19") then a variable is set to the value "yes".
If someone then requires a file called "digialbum.html" from your server, they will only be allowed to see it, if this "yes" is there.
/claus