Htaccess (Hypertext Access) is a configuration file of apache which is used to make changes in the configuration on a directory basis.
This directory can be the root directory or subdirectory of your website.
Uses of the .htaccess file:
1)-Change the default page(i.e index.html to home.html).
2)-URL rewriting for SEO friendly URL.
3)-Custom error pages.
4)-Redirect http to https OR one domain to another domain.
5)-Block IP address OR range of IPs.
6)-Password protection.
7)-Authenticated folder.
Creating a .htaccess file in wordpress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Advantages
1)-Mod_Rewrite
2)-Authentication
3)-Custom Error Pages
4)-Mime Types
5)-SSI (Server Side Includes)
6)-Redirects
7)-Restricting users based on IP
8)-Leveraging Browser Caching
9)-Enabling CORS
10)-Hotlink Protection
Disadvantages
1)-Speed
2)-Security
Copyright ©2022 coderraj.com. All Rights Reserved.