A .htaccess is a hypertext file supported by various web browsers.
In WordPress, this file contain all the rules and security level configurations.
Custom usages of .htaccess
- Authorization, authentication
- A .htaccess file is often used to specify security restrictions for a directory, hence the filename “access”. The .htaccess file is often accompanied by a .htpasswd file which stores valid usernames and their passwords.
- Rewriting URLs
- Servers often use .htaccess to rewrite long, overly comprehensive URLs to shorter and more memorable ones.
- Use allow/deny to block users by IP address or domain. Also, use to block bad bots, rippers and referrers. Often used to restrict access by Search Engine spiders
- Enable server-side includes.
- Directory listing
- Control how the server will react when no specific web page is specified.
- Customized error responses
- Changing the page that is shown when a server-side error occurs, for example HTTP 404 Not Found or, to indicate to a search engine that a page has moved, HTTP 301 Moved Permanently.
- MIME types
- Instruct the server how to treat different varying file types.
- Cache Control
- .htaccess files allow a server to control caching by web browsers and proxies to reduce bandwidth usage, server load, and perceived lag.
So control of this file can help you to do some advanced settings.
In our editor we have given direct access to .htaccess code where you can create your own rules and modify this file directly from your WordPress dashboard.
Here is screenshot
robots.txt is a file where you can define your search engine crawling rules and define web robot rules. When search engine robots crawl your blog then they check this file to see which are the things you want to index in search engine and which you want to hide from search engines.
Note: Don’t make any crucial changes if you don’t know what you are doing.
User-agent: * Disallow: /
The “User-agent: *” means this section applies to all robots. The “Disallow: /” tells the robot that it should not visit any pages on the site.
If you are not using any robots.txt then you can generate one here.
This little utility will help you to create custom robots.txt file for you where you will be able to make the modification and let search engines crawlers do whatever you want.
Here is the screenshot