Pages: [1]
|
 |
|
Author
|
Topic: .htaccess File Codes (Read 1410 times)
|
spiral_one
Mega ZboXian
  
Offline
Posts: 81

|
I am slowly learning what the .htaccess file I saw in my root directory can be used for. I see it can be used, when coded correctly, to prevent hotlinking of images and other files. (music files too??)
When I go to the edit window of the htaccess file it is blank. I am guessing for code input. If you have some codes could you post them? Webtv is running slow and I didn't see anything around the forum. Thanks
spiral (JP)
|
|
|
|
|
Logged
|
|
|
|
ZboX
Founder
Administrator
Posting Maniac
    
Offline
Posts: 1695

What 'ya got there??
|
I am slowly learning what the .htaccess file I saw in my root directory can be used for. I see it can be used, when coded correctly, to prevent hotlinking of images and other files. (music files too??)
When I go to the edit window of the htaccess file it is blank. I am guessing for code input. If you have some codes could you post them? Webtv is running slow and I didn't see anything around the forum. Thanks
spiral (JP) Hi Spiral, Yes the .htaccess files that come with your account are blank. Reason for that is that there are so many different ways you can utilize .htaccess files. And yes denying hotlinking is one of them. However there is an easier way of blocking hotlinking. In your cPanel under "Site Management Tools" click on "Hotlink Protection". When the page comes up, put the url's into the text box that you DO want to allow hotlinking. Naturally at the least you should include the url's to your sites such as http://www.yoursite.com and http://yoursite.com. Include both the version of the url with and without the "www". Then in the next text box, include the file extensions that you DO want to allow hotlinking, i.e.: jpg,gif,png,swf etc. Make sure the extensions do NOT have the period in front of them and only put the comma between the file types. No spaces. In the next form box, input the url of a page that you would like illegal hotlink attempts to see. It can be a simple html page or you can leave it blank if you just want them to get the dreaded empty box. Next click the checkbox if you would like direct url's to your images. In other words if someone directly inputs the url of an image into their goto box they will be able to see the image. But if they hotlink it to a sig or web page etc they won't be able to see it. After that is done click on the "Activate" button. If you would like to deactivate hotlink protection at some later time just go back and click on the "Disable" button. This is much easier than trying to get the correct codes in a .htaccess file on your own. There is always the chance for mistakes that could make it impossible for anyone to see your images, which of course would be bad.
Great post by the way!
Bert
|
|
|
|
|
Logged
|
|
|
|
spiral_one
Mega ZboXian
  
Offline
Posts: 81

|
Ok Bert,
I understood most of your post above. I have no problem with people linking to my webpages. It's the image hotlinking I am concerned about. The instructions you gave are for images.. right?
|
|
|
|
|
Logged
|
|
|
|
|
|
spiral_one
Mega ZboXian
  
Offline
Posts: 81

|
Otay Bert.. one more question. In the 'Redirect Hotlink attempts to:' line, can I use an image URL or does it have to be a HTML/HTM url?
spiral (Jeff)
|
|
|
|
|
Logged
|
|
|
|
|
|
spiral_one
Mega ZboXian
  
Offline
Posts: 81

|
To continue...
I decided to keep this post under .htaccess instead of a new post.
I have a PHP file in a directory that allows me to browse websites much faster with WebTV. I have a blank .htaccess file in that directory also. I don't want to 'Web Protect' it due to the sign in pop-up I would always get. Yes, I even went into CPanel (it wubs me) to the 'Hotlink' info. What is the code I would put into the blank .htaccess file in THAT subdirectory that would allow only me to use THAT php file? I hope I have stated my quest. clearly. Lemme know Bert.
p.s. hope you and Rox are doing well
|
|
|
|
|
Logged
|
|
|
|
|
|
ZboX
Founder
Administrator
Posting Maniac
    
Offline
Posts: 1695

What 'ya got there??
|
Well the problem with cookied logins are they aren't simple. But here's one I found that might work:
http://s25test.zboxhosting.com/temp/cookieprotection_11.zip
Follow the directions in the readme file. If you run into any snags, let me know and we'll hash out the issues.
~;-)
Bert
|
|
|
|
|
Logged
|
|
|
|
spiral_one
Mega ZboXian
  
Offline
Posts: 81

|
Thanks for the file Bert. I'll beam it in to siteman. Had a feeling you were going to say that the best way tho would be to web protect it.. makes sense. I still just might do that. Hoping all is well.
Jeff
|
|
|
|
|
Logged
|
|
|
|
Pages: [1]
|
|
|
|
|