Block external POST requests.


Malicious POST requests from a different domain can be a security threat and the intent behind this attempt is to hack a website. We could easily block these attempts with a very simple step. So, let’s see how this can be done.

I assume you opened the .htaccess file already and this is the file where we will add codes. Please copy these following codes and paste them into your .htaccess file, save the file. Yes, from now on, you are protected from such malicious attacks. 

Here the codes are,

<IfModule mod_rewrite.c>
	RewriteCond %{REQUEST_METHOD} POST
	RewriteCond %{REQUEST_URI} (wp-comments-post|wp-login)\.php [NC]
	RewriteCond %{HTTP_REFERER} !(.*)novicecamp.com [NC,OR]
	RewriteCond %{HTTP_USER_AGENT} ^$
	RewriteRule .* - [L]
</IfModule>

Note: You are seeing it is written novicecamp.com in that code, please delete it and add your domain there (the website you want to protect). 

Thanks for reading.

(Please see related posts below)

11 thoughts on “Block external POST requests.

  • March 5, 2019 at 5:06 pm

    Hiya, I’m really glad I have found this info. Nowadays bloggers publish just about gossips and net and this is actually frustrating. A good website with exciting content, that is what I need. Thank you for keeping this website, I will be visiting it. Do you do newsletters? Cant find it.

    Reply
    • March 5, 2019 at 6:21 pm

      Thank you Christian Spellane. I was also thinking about adding newsletters but I forgot it. Thanks for reminding me of it. I will add it soon.

      Reply
  • March 16, 2019 at 12:10 pm

    Howdy! Do you use Twitter? I’d like to follow you if that would be ok.I’m absolutely enjoying your blog and look forward to new updates.

    Reply
    • March 16, 2019 at 2:54 pm

      Thank you “Marine Morten”. Since this is a new website and I am still working hard to implement it. I will add shares and newsletters soon and a few more functionalities.

      Reply
  • June 22, 2019 at 3:44 am

    It’s amazing to visit this web site and reading the views of all mates on the
    topic of this article, while I am also keen of getting knowledge.

    Reply
  • June 22, 2019 at 2:55 pm

    I really like what you guys are usually up too. This type of clever work and
    exposure! Keep up the very good works guys I’ve
    you guys to blogroll.

    Reply
  • June 26, 2019 at 8:13 am

    Thanks so much for the post.Thanks Again. Awesome.

    Reply
  • June 27, 2019 at 12:23 pm

    Oh boy What would I tell? Really… really liked the articleThank you so much!

    Reply
    • June 30, 2019 at 12:50 am

      Thank you Joel Lanz. You made me happy with this amazing comment.

      Reply
  • July 9, 2019 at 8:36 pm

    You come across very wise and thoughtful. Is it ok to ask a question?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *