Check Latest Dec 2019 Deals ===> CHECK HERE

CatchUpdates.com

Protect your content with a DMCA.com Protecion Badge

  • Home
  • Blogging Tips
  • SEO
  • Make Money
  • WordPress
  • Technology
    • Techo-World
    • Computer Stuffs
  • Misc Updates
    • Life Style
    • Top 10 List
  • Hot Deals
  • Write For Us
  • About Us

What is .htaccess File ? How To Secure Your Blog With It

Last updated on August 31, 2016 By Mohit Arora 1 Comment

  • 353shares
  • Share on Facebook
  • Share on Twitter
  • Reddit
  • WhatsApp
  • Telegram
  • Buffer
  • Pocket

.htaccess file is an acronym for Hypertext Access. It is a configuration file used by Apache-based web servers that control the directory. These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable or disable additional functionality and features that the Apache Web Server software has to offer.

If you are using any CMS (Drupal, Joomla, WordPress or Blogger) then you might have definitely seen .htaccess file and wondered what exactly this do or what is wordpress htaccess file location. It can be found in cPanel under Web Root folder (.htaccess file can be hidden, while opening check ‘Show hidden files’).

htaccess File_1

htaccess file

htaccess file1

If you are using WordPress SEO by Yoast plugin you can edit htaccess file there directly – SEO –> Tools –> File Editor –> .htaccess File

Note: Make sure you are keeping a backup of the previous .htaccess file before making ay changes.

htaccess File is useful in many ways:

Custom Error Pages:

.htaccess file additionally allows you to create custom error pages for your site. Most common error is ‘Error 404 : Page Not Found’ when a link is broken and cannot be found. To make a page look friendlier and to provide more information to the site visitor you can use the .htaccess file to create custom error pages.

Design an error page that you want to showcase whenever your blog gets Page Not Found error and provide its location in the .htaccess file.

ErrorDocument 404 /customError.html

Mime Types:

Sometimes our site features some application files but our server is not set up to deliver those files. In this case, we need to add MIME types to your Apache server in the .htaccess file with the following code.

AddType text/css .css

AddType text/x-component .htc

AddType application/x-javascript .js

AddType application/javascript .js2

AddType text/javascript .js3

AddType text/x-js .js4

AddType text/html .html .htm

AddType text/richtext .rtf .rtx

AddType image/svg+xml .svg .svgz

AddType text/plain .txt

AddType text/xsd .xsd

AddType text/xsl .xsl

AddType text/xml .xml

AddType video/asf .asf .asx .wax .wmv .wmx

AddType video/avi .avi

AddType image/bmp .bmp

Protect wp-config.php with .htaccess file

WP-config.php is the most crucial file in your blog. It allows data storing and retrieving. The information about username, password, host and database name are present in your wp-config.php. Protecting your wp-config.php should be your prior concern. Below code helps you to do so:

<Files wp-config.php>

order allow,deny

deny from all

</Files>

Restrict Spam visitors and Block them by using IP Address

When your site gets popularity and it attracts huge visitor base, it increases chances to be attacked by spammers or annoying visitors. You need to take proper action by stopping them to spam your site. Below code will allow you to restrict certain visitors:

<Limit GET POST>

order allow,deny

deny from {IP Address of the Denied Visitor1}

deny from {IP Address of the Denied Visitor2}

allow from all

</Limit>

Restricting other users to access Admin area

In our blog, we have many roles like editor, author, subscriber and author having partial access. But you need to restrict them to use your admin area. To do this, you can add the following code to the .htaccess file and fill your IP address –

order deny,allow

allow from {your IP Address}

deny from all

Got any questions? Feel free to contact.

Also, share your views or strategies that you use to secure your blog.

  • Author
  • Recent Posts
Mohit Arora
Follow Me

Mohit Arora

Founder at CatchUpdates
Hi, I am Mohit Arora, a passionate blogger and addicted reader. You can check my another blog TutorialsJar where I share programming tutorials.

You can connect with me on Instagram Or Quora And Linkedin as well.
Subscribe to CatchUpdates feed via RSS
Mohit Arora
Follow Me

Latest posts by Mohit Arora (see all)

  • Amazing Digital PR Tactics That Can Help Your Business Grow - October 30, 2019
  • 10 Premium & Free HTML5 Templates for All Occasions - September 25, 2019
  • 10 Best Two Tier Affiliate Programs With Recurring Commission - September 14, 2019

Filed Under: SEO Tagged With: htaccess file

Comments

  1. temp mail says

    March 27, 2019 at 10:15 pm

    What are some of the greatest prominent/ideal weblogs relating to mobile telephones and wi-fi tech?

Leave a Reply Cancel reply

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

All the data shown above will be stored by CatchUpdates on https://catchupdates.com/. At any point of time, you can contact us and select the data you wish to anonymise or delete so it cannot be linked to your email address any longer. When your data is anonymised or deleted, you will receive an email confirmation. We also use cookies and/or similar technologies to analyse customer behaviour, administer the website, track users' movements, and to collect information about users. This is done in order to personalise and enhance your experience with us.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Advertisement




Exclusive Deal For You!

Find a domain starting at $0.88

powered by Namecheap

6 Must Have Blogging Tools

GrammarlyWP Rocket
Revive SocialThrive Leads
Genesis FrameworkLong Tail Pro

Best Affiliate Programs To Join

ShareASaleTemplateMonster
WP EngineCuelinks
OptinMonsterLinkTrackr

Recommended Articles

10 Ultimate Blogging Lessons From Mahabharata
Top 15 Ways To Make Money From Your Website
10+ Best Paying Affiliate Programs in ShareASale To Join
50+ Best Genesis Child Themes For Your Blog
Cuelinks Review - Best Indian Affiliate Program?
NameCheap Coupon – 50% Off On Shared Hosting & 20% OFF on VPS
MochaHost Coupon - 50% Off Lifetime Discount
10 Two-Tier Affiliate Programs With Recurring Commission
10 Reasons Why You Should Purchase Genesis Framework
15 Motivational Bollywood Songs To Inspire You
ShareASale Affiliate Program: Make Money With Affiliate Marketing
10 Best Paying Google AdSense Alternatives 2019


Contact Us| Privacy Policy | Sitemap | Disclaimer

Copyright 2013 - 2019 All Rights Reserved. Built on Genesis Framework. Hosted on NameCheap Hosting

  • 353shares
  • Facebook320
  • Twitter0
  • LinkedIn4
  • Reddit4
  • WhatsApp1
  • Telegram0
  • Pinterest0
  • StumbleUpon0
  • Buffer0
  • Pocket0