Cannot Block url via HTACCESS

Discussion in 'Apache' started by pspcustomfirmware, Apr 8, 2016.

  1. #1
    Good morning all, I have been hit with a pretty hard issue I cant seem to have fix, I have done everything I can, check all over the forum and did all suggestion everyone recommended online, but nothing has work .. Im trying to block the follow page

    Page to be Block

    https://www.thirty5tech.com/vid/index.php?a=watch/Kws9r20D2X4

    This is the content of my HTACCESS file

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{THE_REQUEST} ^.*(vid/index.php?a=watch/Kws9r20D2X4).* [NC]
    RewriteRule ^(.*)$ - [F,L]
    </IfModule>

    <ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteOptions inherit
    RewriteBase /vid/
    ## Application Handler
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)?$ /vid/index.php?a=$1 [QSA,NC,L]
    ## Error 404 ##
    ErrorDocument 404 /index.php?a=404
    </ifModule>

    ------------------------------------------------------


    Thanks for all your help guys ,, Much appreciated .
     
    pspcustomfirmware, Apr 8, 2016 IP
  2. RicScotland

    RicScotland Greenhorn

    Messages:
    8
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    23
    #3
    Hi..
    better to use the HTTP_REFERER
    Like this
    just one site:

    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} badsite\.com [NC]
    RewriteRule .* - [F]

    or a bunch of them:

    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} badbadsite\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} anotherbadbadsite\.com
    RewriteCond %{HTTP_REFERER} theabsoluteworstsite\.com
    RewriteRule .* - [F]

    hope it helps
     
    RicScotland, Apr 8, 2016 IP
  3. pspcustomfirmware

    pspcustomfirmware Active Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #3
    Hi Ric

    Thanks for the suggestion you provided, unfortunately did not work...

    I was still able to access the page ..

    this is an automated youtube video site , so I do not have a place to block video, so I have to block it via htaccess or cause the page to return a 404 error code
     
    pspcustomfirmware, Apr 10, 2016 IP
  4. Bitpalace

    Bitpalace Greenhorn

    Messages:
    53
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    13
    #4
    <Location "/vid/index.php?a=watch/Kws9r20D2X4">
    Order Allow,Deny
    Deny from all
    </Location>

    If that doesn't work, remove the leading / from the Location directive.
     
    Bitpalace, Apr 10, 2016 IP