• From research I’ve done the following can be done to stop certain web sites from access our web site.

    Example 1.
    <Limit GET,POST>
    order allow,deny
    deny from some-evil-isp.com
    allow from all
    </Limit>

    Example 2.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} some-evil-isp\.com [NC,OR]
    RewriteRule .* – [F]

    The problem I have is the current .htaccess with its URL rewriting doesn’t play nice with the above options. Example 2 stops everyone.
    Example 1 stops no one.

    Anyone know how to update the following .htacces code to stop specific web sites.

    # BEGIN WordPress

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

Viewing 1 replies (of 1 total)
  • Thread Starter jbowshaw

    (@jbowshaw)

    i got it to work.

    Put the rewrite conditions above the wordpress code like this.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} sogou\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} concrete\.twohundredpornfucksn\.net [NC,OR]
    RewriteCond %{HTTP_REFERER} yandex\.ru [NC,OR]
    RewriteCond %{HTTP_REFERER} pic\.sogou\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} twohundredpornfucksn\.net [NC]
    RewriteRule .* – [L,F]

    # NOTE make sure last rewrite cond above has [NC] ONLY and not [NC,OR]

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    </IfModule>

    # END WordPress

Viewing 1 replies (of 1 total)
  • The topic ‘.htaccess (stop access from certain websites)’ is closed to new replies.