By installing a WordPress (or other CMS, e.g Drupal, Joomla) you would definitely come across a file called .htaccess. If you've wondered what it is and what it does, you're in the right place.
The .htaccess file is a powerful tool that can secure your website, but also improve its performance in speed. But first you should understand the basics of .Htaccess and then let's see how you can use it.
What is the .htaccess file?
It's an abbreviation derived from the terms Hypertext Access. It is basically a valuable configuration tool used by Apache Web Servers to control the folders contained and all the subfolders within them.
If you cannot see the file on your server or in the package hosting that you use, is because the dot at the beginning of the name makes it hidden.
To see it you need to connect to the server with someone ftp client (it's a link for the free application Filezilla, of course you can use any client you want), that you have set to show hidden files.
To edit the file, use the free Windows tool notepad ++ (it will be good for editing files stored on a linux server not to use the classic Windows notepad).
What can you do with a .htaccess file?
- to protect the files in the folder that is located
- to prohibit certain IPs from viewing your site
- to fix links that do not work with redirection to the correct ones
- to remove the category from URLs
- block IP addresses and search engines
- specify whether your website will use www or just the domain name
- to compress your website for faster speed
- remove all question marks (?) from the links on your site
- redirect all your visitors to a different web site, regardless of the URL they type.
- And much more
Continue to the next post