Est. 2003
Home Help Login Register
News: Welcome to ZboX Webhosting.
10 Megs

10 MB Disk
1 GB Transfer
$10.00 per year
25 Megs

25 MB Disk
2 GB Transfer
$25.00 per year
50 Megs

50 MB Disk
3 GB Transfer
$50.00 per year
75 Megs

75 MB Disk
4 GB Transfer
$75.00 per year
500 Megs

500 MB Disk
10 GB Trans
$100.00 yr.

+  ZboX Webhosting Est. 2003. Now in our Fifth year!
|-+  Help!
| |-+  Problems and/or Questions
| | |-+  .htaccess File Codes
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: .htaccess File Codes  (Read 1407 times)
spiral_one
Mega ZboXian
***
Offline Offline

Posts: 81



.htaccess File Codes
« on: November 22, 2004, 06:08:43 PM »

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


My Website @Zbox

Ink and Paper Spiralbound

Code:
I am here to keep myself from going crazy just thinking about it
ZboX
Founder
Administrator
Posting Maniac
*****
Offline Offline

Posts: 1695


What 'ya got there??


.htaccess File Codes
« Reply #1 on: November 22, 2004, 08:54:52 PM »

Quote
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!

 biggrin

Bert
Logged

Homepage / Community: http://zboxhosting.com

Contact: sales@zboxhosting.com
"If you don't eat your meat you can't have any pudding! How can you have any pudding if you don't eat your meat?"
spiral_one
Mega ZboXian
***
Offline Offline

Posts: 81



.htaccess File Codes
« Reply #2 on: November 23, 2004, 04:31:40 PM »

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


My Website @Zbox

Ink and Paper Spiralbound

Code:
I am here to keep myself from going crazy just thinking about it
ZboX
Founder
Administrator
Posting Maniac
*****
Offline Offline

Posts: 1695


What 'ya got there??


.htaccess File Codes
« Reply #3 on: November 23, 2004, 08:16:19 PM »

Quote
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?
Actually Spiral the above instructions are for any type of file you would like to have hotlinking disabled. It could even be music files such as mid,mod,mp3,wav for instance. Just put the file types in the form box provided on the page.

Bert
Logged

Homepage / Community: http://zboxhosting.com

Contact: sales@zboxhosting.com
"If you don't eat your meat you can't have any pudding! How can you have any pudding if you don't eat your meat?"
spiral_one
Mega ZboXian
***
Offline Offline

Posts: 81



.htaccess File Codes
« Reply #4 on: November 24, 2004, 04:02:20 PM »

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


My Website @Zbox

Ink and Paper Spiralbound

Code:
I am here to keep myself from going crazy just thinking about it
ZboX
Founder
Administrator
Posting Maniac
*****
Offline Offline

Posts: 1695


What 'ya got there??


.htaccess File Codes
« Reply #5 on: November 24, 2004, 08:14:59 PM »

Quote
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)
Hi Spiral,
That would be for a html page. Simillar to a "404 error" page. Of course it can be anything you would like. And yes you could place images on the page if you would like.

Bert
Logged

Homepage / Community: http://zboxhosting.com

Contact: sales@zboxhosting.com
"If you don't eat your meat you can't have any pudding! How can you have any pudding if you don't eat your meat?"
spiral_one
Mega ZboXian
***
Offline Offline

Posts: 81



Re: .htaccess File Codes
« Reply #6 on: August 04, 2006, 06:36:57 AM »

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


My Website @Zbox

Ink and Paper Spiralbound

Code:
I am here to keep myself from going crazy just thinking about it
ZboX
Founder
Administrator
Posting Maniac
*****
Offline Offline

Posts: 1695


What 'ya got there??


Re: .htaccess File Codes
« Reply #7 on: August 04, 2006, 07:51:02 AM »

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

Hi Spi,
Unless I am misunderstanding, you want that page accessible only to you correct? If that's the case, the only way you could do that would be to password protect the page using Cpanel's "Web Protect" feature. FYI all Cpanel's Web Protect feature does is generate the code needed to protect the page using .htaccess. And places the code in the .htaccess file of your chosen directory. However for your page, I think a cookied login script would work well. Of course there the problem could be whether the generated cookies would be compatible with Webtv. Let me check around and I'll see what I can find.

~;-)

Bert
Logged

Homepage / Community: http://zboxhosting.com

Contact: sales@zboxhosting.com
"If you don't eat your meat you can't have any pudding! How can you have any pudding if you don't eat your meat?"
ZboX
Founder
Administrator
Posting Maniac
*****
Offline Offline

Posts: 1695


What 'ya got there??


Re: .htaccess File Codes
« Reply #8 on: August 05, 2006, 02:29:37 AM »

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

Homepage / Community: http://zboxhosting.com

Contact: sales@zboxhosting.com
"If you don't eat your meat you can't have any pudding! How can you have any pudding if you don't eat your meat?"
spiral_one
Mega ZboXian
***
Offline Offline

Posts: 81



Re: .htaccess File Codes
« Reply #9 on: August 05, 2006, 06:12:15 AM »

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


My Website @Zbox

Ink and Paper Spiralbound

Code:
I am here to keep myself from going crazy just thinking about it
Pages: [1] Go Up Print 
« previous next »
Jump to:  


Login with username, password and session length

ZboX Webhosting Est. 2003. Now in our Fifth year! | Powered by SMF 1.0.10.
© 2005, Simple Machines LLC. All Rights Reserved.
Page created in 0.105 seconds with 21 queries.