Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Problem with .htaccess  (Read 6990 times)

0 Members and 1 Guest are viewing this topic.

biesky83

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Problem with .htaccess
« on: April 22, 2005, 02:57:25 am »

Alright so i've had a problem with hotlinking in the past and the rewrite code you posted for apache servers works great. Here is the code:

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp.*.*jpg|jpeg|gif|png|bmp)$ http://www.mysite.com [R,NC]


Now that code works great for trying to steal pics. But my problem is that i have videos also on my gallery. I have .avis, .wmvs, and .mpegs. I tried to modify the htaccess file to block those file types as well but it's not working. Here is what I'm using:

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.com$      [NC]
RewriteRule .*\.(jpg|jpeg|avi|wmv|mpeg|gif|png|bmp.*.*jpg|jpeg|avi|wmv|mpeg|gif|png|bmp)$ http://www.mysite.com [R,NC]

What am I doing wrong that the code won't block avis, wmvs, and mpegs??
Logged

OmegaGOD

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • I approve.
Re: Problem with .htaccess
« Reply #1 on: April 22, 2005, 03:57:18 am »

Your additions to .htaccess looks right. I have the same thing you have except I have more extentions in my list to protect from hotlinking. Try accesing the files again, but  before, dump your cache. You web-browser may just be reloading the file from its cache instead of hitting the web server

Hope this helps,

--OmegaGOD
Logged
Please do not PM me with support questions. Please read the manual and then if posting questions please place them in the proper sub-boards.

biesky83

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Problem with .htaccess
« Reply #2 on: April 22, 2005, 04:06:48 am »

My problem is when I upload that .htaccess file it just prevents everyone from even viewing the videos. The windows media player appears but it just won't play. Once i remove the .htaccess file then it works again. I'll try your suggestions with clearing my cache and see what happens. I didn't think about doing that.
Logged

OmegaGOD

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • I approve.
Re: Problem with .htaccess
« Reply #3 on: April 22, 2005, 04:10:35 am »

Yes, the .htaccess will prevent users from hotlinking to your files. You should still be able to access those files through internal links from your webpage.
Logged
Please do not PM me with support questions. Please read the manual and then if posting questions please place them in the proper sub-boards.

biesky83

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Problem with .htaccess
« Reply #4 on: April 22, 2005, 04:15:18 am »

nope. just re-uploaded it after i cleared cache and everything. i even restarted to be 100 percent sure and it doesn't let you actually view the videos when I upload that .htaccess. any other ideas? or anything else i can do to prevent people from downloading the videos?

i read your hotlinking tutorials but all that does is prevent other sites from directly linking. you can still type in the address bar and get the file. granted, most newbies don't know how to click view source but many people can.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Logged

OmegaGOD

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • I approve.
Re: Problem with .htaccess
« Reply #6 on: April 22, 2005, 04:49:14 am »

Logged
Please do not PM me with support questions. Please read the manual and then if posting questions please place them in the proper sub-boards.

biesky83

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Problem with .htaccess
« Reply #7 on: April 22, 2005, 07:18:51 am »

http://www.lunarforums.com/forum/viewtopic.php?t=22829

thanks for all that info. the only problem is you have to be pretty good with programming to incorporate that into coppermine. i don't know if i'm that advanced yet. over the past year i've gotten pretty good with php and perl but i would have to modify alot of that to make it work with my board.
Logged

biesky83

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Problem with .htaccess
« Reply #8 on: April 22, 2005, 07:27:06 am »

Thanks for all the info from both of you. It looks as if its easy to block the direct downloading through a url of videos but the problem is you can't have them actually viewable from your site. After reading all of that I was wondering if you guys have ever thought about developing some code that hides the album and filename in view source or something that makes it harder to find?
Logged

OmegaGOD

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • I approve.
Re: Problem with .htaccess
« Reply #9 on: April 22, 2005, 03:56:32 pm »

I think I might have mis-interpreted your question. Are you trying to have your videos streamed and played from within coppermine? For example, If you click on a video, it will open a mini-player within the browser window and to play it within the same page instead of opening a the player independent of the web-browser, allowing your users to download the file before playing.

Logged
Please do not PM me with support questions. Please read the manual and then if posting questions please place them in the proper sub-boards.

biesky83

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Problem with .htaccess
« Reply #10 on: April 22, 2005, 07:22:23 pm »

I think I might have mis-interpreted your question. Are you trying to have your videos streamed and played from within coppermine? For example, If you click on a video, it will open a mini-player within the browser window and to play it within the same page instead of opening a the player independent of the web-browser, allowing your users to download the file before playing.



Yeah, I'm sorry I should have been a little more clear on the issue. We have a gallery set up with our phpbb website. We have an average of 50-60 users online at a time. We give everyone public access to the pictures of the gallery but have the videos as private for long term site members. They do stream straight from coppermine. Meaning you have to use IE6 and nothing else. I really wish firefox would work on making it compatible but oh well. Anyway all it would take is one long term site member to click view source, scroll down and see the direct URL path.

The dev. guy above you posted a very useful article (but im sure you already knew that i just wasn't clear). I guess its fairly complex to prevent hotlinking of windows media files because then you can't stream them straight from the site. It's the way media player gets the video and doesn't send a referrer or something along those lines.

The problem with the article that was posted is I don't know if I'm good enough with php yet to be able to adapt that code to make it work on my board. It will probably take me a few months (no free time) to actually get it to work. I was just curious if either of you knew of any add-ons or hacks or anything that might hide the path a little better in view source. I'll pretty much do anything because I'm on a dedicated server but its killing my bandwidth.

The mod-rewrite works great for the pictures though.
Logged

MstrMitch

  • Guest
Re: Problem with .htaccess
« Reply #11 on: May 14, 2005, 10:18:21 pm »

sorry to interupt you but I saw you were using PHPBB bridging to coppermine. I am having a hell of a time trying to make an htaccess file that hides a url from public viewing but opens it up on a link from PHPBB. my url for pictures is http://www.mysite.org/pics/ and my board is at http://www.mysite.org/board/

I tried to use this htaccess

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.org/board(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|swf|mpeg|wmv|mov|mp3|mp4|mpg|png|psd|txt|doc)$ http://www.mysite.org [R,NC]

but it doesnt work. it still blocks the pictures from the link on the board as well as to the public. I am using SID=? for the session ID in PHPBB, but that changes each time. should i get rid of that? how did you overcome it.

Mitch
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.