Results 1 to 6 of 6

prevent hotlink

This is a discussion on prevent hotlink within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi, I have a problem when trying to prevent hotlink, so I have the htaccess file: # Comment the following ...

  1. #1
    Senior Member
    Real Name
    robert
    Join Date
    Apr 2008
    Location
    Madrid
    Posts
    149
    Liked
    7 times

    prevent hotlink

    Hi, I have a problem when trying to prevent hotlink, so I have the htaccess file:


    # Comment the following line (add '#' at the beginning)
    # to disable mod_rewrite functions.
    # Please note: you still need to disable the hack in
    # the vBSEO control panel to stop url rewrites.
    RewriteEngine On

    # Some servers require the Rewritebase directive to be
    # enabled (remove '#' at the beginning to activate)
    # Please note: when enabled, you must include the path
    # to your root vB folder (i.e. RewriteBase /forums/)
    #RewriteBase /

    #RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
    #RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]

    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

    RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
    RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ vbseo.php [L,QSA]

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A300
    ExpiresByType image/x-icon A2592000
    ExpiresByType application/x-javascript A604800
    ExpiresByType text/css A604800
    ExpiresByType image/gif A604800
    ExpiresByType image/png A604800
    ExpiresByType image/jpeg A604800
    ExpiresByType text/plain A300
    ExpiresByType application/x-shockwave-flash A604800
    ExpiresByType video/x-flv A2592000
    ExpiresByType application/pdf A300
    ExpiresByType text/html A300
    </IfModule>

    but when I add:

    # Comment the following line (add '#' at the beginning)
    # to disable mod_rewrite functions.
    # Please note: you still need to disable the hack in
    # the vBSEO control panel to stop url rewrites.
    RewriteEngine On

    # Some servers require the Rewritebase directive to be
    # enabled (remove '#' at the beginning to activate)
    # Please note: when enabled, you must include the path
    # to your root vB folder (i.e. RewriteBase /forums/)
    #RewriteBase /

    #RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
    #RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]

    RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

    RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
    RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ vbseo.php [L,QSA]

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A300
    ExpiresByType image/x-icon A2592000
    ExpiresByType application/x-javascript A604800
    ExpiresByType text/css A604800
    ExpiresByType image/gif A604800
    ExpiresByType image/png A604800
    ExpiresByType image/jpeg A604800
    ExpiresByType text/plain A300
    ExpiresByType application/x-shockwave-flash A604800
    ExpiresByType video/x-flv A2592000
    ExpiresByType application/pdf A300
    ExpiresByType text/html A300
    </IfModule>

    RewriteCond % !^http(s)://([a-z0-9]+\.)?foroxd.com [NC]
    RewriteRule \.(jpg jpeg gif png avi mov swf flv)$ - [NC,R,L]


    is left blank the web

    Greetings and thanks

  2. #2
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hello Robert,

    You should use:

    Code:
    RewriteCond %{HTTP_REFERRER} !^https?://([a-z0-9]+\.)?foroxd.com [NC]
    RewriteRule ^.*\.(jpe?g|gif|png|avi|mov|swf|flv)$ - [F]
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  3. #3
    wac
    wac is offline
    Senior Member
    Real Name
    toto
    Join Date
    Apr 2009
    Posts
    134
    Liked
    0 times
    Hi Andres:

    1. Does that code prevent hotlinking of all images?

    2. Where exactly do you put it in Vbseo's .htaccess? At the top, at the end, below what?


    Quote Originally Posted by Andrés Durán Hewitt View Post
    Hello Robert,

    You should use:

    Code:
    RewriteCond %{HTTP_REFERRER} !^https?://([a-z0-9]+\.)?mysite.com [NC]
    RewriteRule ^.*\.(jpe?g|gif|png|avi|mov|swf|flv)$ - [F]

  4. #4
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hello,

    That RewriteRule rarely can conflict with vBSEO installations; if it's your case, try putting those rules right after "RewriteEngine" On line on your .htacccess, otherwise, you can add it at the very end of the .htaccess.
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  5. #5
    Senior Member
    Real Name
    robert
    Join Date
    Apr 2008
    Location
    Madrid
    Posts
    149
    Liked
    7 times
    Sorry for the delay, I had to put it because I was so problems with gif and png the same forum.

    RewriteCond %{HTTP_REFERRER} !^https?://([a-z0-9]+\.)?foroxd.com [NC]
    RewriteRule ^.*\.(jpe?g|avi|mov|swf|flv)$ - [F]

    Thank you very much and best regards

  6. #6
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    You're welcome .
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


Similar Threads

  1. hotlink sorusu
    By Eyewear in forum Türkçe
    Replies: 2
    Last Post: 10-03-2009, 05:23 AM
  2. Problem with hotlink protection
    By shuffle in forum URL Rewrite Settings
    Replies: 8
    Last Post: 09-22-2009, 09:53 AM
  3. Hotlink Protection
    By desender in forum Türkçe
    Replies: 5
    Last Post: 05-25-2009, 10:18 AM
  4. Hotlink Protection VB attachments
    By Snookieboy in forum General Discussion
    Replies: 0
    Last Post: 07-15-2008, 07:26 PM
  5. .htaccess for hotlink protection
    By Mert Gökçeimam in forum General Discussion
    Replies: 7
    Last Post: 03-06-2007, 09:28 PM

Posting Permissions

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