What is .htaccess File?
With the help of a .htaccess file, you can, for example, add password protection to a folder and provide authorization. One of the best things about this file application is that you can create a .htaccess file for your own website without the need for any code knowledge.
What can be done with .htaccess File!
- You can create SEO compatible link structure.
- You can do hotlink blocking
- You can hide files
- You can edit error pages
- You can set folder authorization limitation.
- You can block enemy bots
- You can configure WWW
- You can perform security operations such as file encryption and password protection
- You can block ip
- You can do domain redirection
- You can optimize your data by compressing it
- You can create your care page
- You can block spam.
- You can detect and redirect iPhone and do many more operations.
How to Use the .htaccess File and Where to Find It?
# BEGIN HTTPS Redirection
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END HTTPS Redirection
- Log in to your cPanel administration panel,
- Click on the file manager icon,
- Check the “Show hidden files” option,
- Select the document directory click the “go” button,
- You can view and edit the .htaccess file under the public_html folder.
Impact of .htaccess File on SEO
1. 301 Redirects
2. Dynamic URL – Static URL Redirects
For your URLs to be SEO-friendly, it is important that they are easy to read and understand when viewed, and that they are relevant to the content. If the URL structure is easy to read when you see it and you can understand that it is relevant to the content, it means that this URL has a structure that is compatible with SEO.