Results 1 to 4 of 4

Thread: Mod Rewrite Hotlinking

  1. #1
    Words paint the real picture gaystoryman's Avatar
    Join Date
    Apr 2004
    Location
    western canada
    Posts
    2,151

    Mod Rewrite Hotlinking

    Got a question, well a two part question actually regarding using mod rewrite and anti hotlinking.

    I want to be able to pull images from one domain to others, but deny anyone outside those domains from hotlinking to the images. So do I simply add this line with each domain name to the mod rewrite?

    Code:
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?my-domain.com/ [NC]
    Second question, do I need to modify the line in the domain that is pulling the images.

    Say I want to pull images from my-domain-1 to my-domain-2 and my-domain-3, do I need to adjust the mod rewrite code that prevents hotlinking on those two domains to include the referring domain of images?

    As you can tell, me no techie or geek, any comments, greatly appreciated.

    :innocent:
    Webmasters: Add Custom Stories To Your Sites Custom Gay Stories

    My Blogs Gay Talk, Free Gay Fiction, Erotic Fiction Online


  2. #2
    You do realize by 'gay' I mean a man who has sex with other men?
    Join Date
    Oct 2003
    Location
    New Orleans, Louisiana.
    Posts
    21,635
    Wherever you are hotlinking from simply add as many domains as you own like this...

    PHP Code:
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain1.com(/)?.*$     [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain2.com(/)?.*$     [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain3.com(/)?.*$     [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain4.com(/)?.*$     [NC] 
    Then upload that to domain.com - Where that is the domain you are hotlinking from.

    Is that what you mean?

    Regards,

    Lee


  3. #3
    Words paint the real picture gaystoryman's Avatar
    Join Date
    Apr 2004
    Location
    western canada
    Posts
    2,151
    Yep, just wasn't certain if that was it, or if there was more to it... cool, thanks Lee :thumbsup:
    Webmasters: Add Custom Stories To Your Sites Custom Gay Stories

    My Blogs Gay Talk, Free Gay Fiction, Erotic Fiction Online


  4. #4
    Think big. Shoot hard.
    Join Date
    Jul 2007
    Posts
    826
    Quote Originally Posted by gaystoryman View Post

    Say I want to pull images from my-domain-1 to my-domain-2 and my-domain-3, do I need to adjust the mod rewrite code that prevents hotlinking on those two domains to include the referring domain of images?
    No. Just on the domain with the image do you have to do anything.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •