What is .htaccess file?
Here we will know about How to setup .htaccess file, It is a configuration file that controls how the web server responds to various requests. .htaccess means [Hypertext Access].
You can see .htaccess file in the file manager or .htaccess file is hidden in the file manager because all folders that start with a dot(.) in FileManager are hidden by default. .htaccess file is a very important file. This file lets you control many aspects of the Apache server.
How to view .htaccess file if it is hidden. By Cpanel
Cpanel gives you an easy way to access or create
- Go to your hosting Cpanel.
2. Open the file manager in your Cpanel file section
3. The File-manager will open in the next window. Click the setting button on the top right.
4. A pop-up will open, check the show hidden files checkbox and click the save button.
5. Now, the file manager will show all the hidden files, Right-click on the file and select to view or edit.
6. If there is no .htaccess file, then you need to make one.
7. To create go to Filemanager homepage, then click on Public_html Folder.
Here you need to create a .htaccess file.
8. Now Click the File button at the top left.
9. In the new window, enter the file name .htaccess click create a new file.
10. select to edit. or click the file to select edit and click on edit.
11. When the Text editor dialogue box appears make sure utf-8 is selected for encoding, and then click edit.
- The text editor will open in a new window, you see a blank window cause it’s a new file so you need to edit the redirection or other codes that you have.
How to Setup .htaccess file using FTP(file transfer protocol)
- Open FileZilla app and log in to your web space using FTP
- Double-click public_html to list your website files
- Select .htaccess, right-click and select View/Edit
- Enter your new code. Save the file once you have finished editing
- Click Yes in FileZilla to upload your new .htaccess file