Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Proud She-Geek

    .htaccess, hotlinking, and allowed referrers?

    Is it possible to have an .htaccess set up so that it only allows linking from a particular server/domain?

    This is what I have for my .htaccess so far:
     RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
    RewriteRule \.(gif|jpg)$ - [F]
    Would it be as simple as adding something like this below the line?
    RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)* [NC]
    Last edited by P-nut; 04-18-2005 at 07:41 AM.
    <?php echo "Signature here"; ?>

  2. #2
    Join Date
    Oct 2001
    Ann Arbor, MI U.S.A.

    Yep, it's that easy

    Chris Wells [clwells - at -]
    Nexcess - Beyond Hosting
    Dearborn, MI DC ● Southfield, MI DC
    Wordpress Hosting, Magento Hosting & More!

  3. #3

    another question about hotlinking and htaccess

    in my awstats logs i check that a lot of scam, porno, casino sites send my fake traffic. why fake, because trying to accesss this site, u are redirected to another such a site (they use external encoded js scripts).
    and also , i don't think that there are any links to my site.

    now the question:

    how can i using htaccess file dissallow by refferer.

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} ^http://www\.casino-y\.com
    RewriteRule ^/.* http://site-to-redirect/ [L,R]
    i know such a code must work, but unfortunately it don't work in my case [Apache with mod_rewrite enabled]

    and few questions.

    1. must i use this line RewriteEngine on once again, if once i did in htaccess file, to redirect from non www version to www version.

    2. what's a redirected url to wrote ? as i dissalow their access to whole domain, the cann't redirect to any page ?
    may be something like or miscrosoft :-)

    3. may be it will the best to disallow by refferer IP {otherwise i must close for www and non www version}

    it will be longlist as there are ~25-30 sites sending fake traffic

    Your Health Encyclopedia
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language

Posting Permissions

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