How to Edit an .htaccess File
There are many methods which you can follow, and here we will look into three of them:
How to edit WordPress .htaccess file using cPanel:
Most web hosting companies offer cPanel, which makes it easier for non-technical people to play around with and edit their .htaccess file.
The cPanel is especially useful for non-technical people who need to add or edit some codes. They can quickly do it using this online editor.
First, log in to your cPanel. Click on “File Manager” under the “Files” section.
Depending on your WordPress installation directory, you will find .htaccess at the root of your WP installation.
Select the .htaccess file and click on “Edit”. This will open the editor in a new tab and you can make changes right from there.
Copy the code from the Blog Mirror dashboard and save the file.
Editing .htaccess from the WordPress dashboard:
There are many WordPress plugins which offer the feature to edit your .htaccess file from the WP dashboard. If you are using the SEO by Yoast plugin, you can access it from SEO by Yoast > Edit Files. You’ll then copy the Blog Mirror .htaccess after the #END Wordpress coment.
Editing .htaccess file using FTP client:
Use any free FTP client like FileZilla and log in to your FTP hosting account. Browse to the root of your installation. If you don’t see your .htaccess file you have to enable Show Hidden Items to see the .htaccess file.
Here is how you can enable it:
FileZilla Menu Options > Select Server > Force showing hidden files
Now navigate to the root folder of your domain. Your .htaccess file will be at the root of the folder.
Download your .htaccess file and paste the code from the Blog Mirror and paste it at the end of the .htaccess file.
Make sure you take a backup of your .htaccess file before you start editing it. You can use your OS default text editor to edit the file, and once it’s edited, simply re-upload it back.
- Make sure that the permission of your .htaccess file is 644 and not 777.