Confused with updating .htaccess file? When you try to customize the Permalink structure of your wordpress blog or site, you will be asked to update the .htaccess file.
You will get this below message when you try to change the permalink structure from the default one.
“If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all”.
When I tried to change the permalink structure of this site, the same message appeared and I was confused. The first question was how to find the .htaccess file? After some internet search, I found the answer and thought of posting some information on this topic.
Where is .htaccess file located?
Most of the WordPress users are troubled with this question. If you are familiar with “Filezilla”, it is pretty simple to find .htaccess file. But if you are hearing about Filezilla for the first time, don’t worry. Simply download Filezilla from here. When you open up filezilla, provide the username, password and port number provided by your host in the specific areas. Now you can start changing or updating your files on the remote server.
Usually the .htaccess files are kept hidden. Click on the server option and check the “force showing hidden files” option to view the hidden files.
If you can see the .htaccess file in the root, right click on it and change the file permissions.
This is the case when .htaccess file is present in the root files. But what to do if you can’t locate the file or such file is not present?
How to Create .htaccess file?
It is pretty simple to create the .htaccess file using Notepad. Simply make a Notepad file (with name htaccess.txt) and copy the following code into it.Note that the file extension will be .txt and we will be changing it later after uploading the file to server.
This code appears in the permalink settings page when you attempt to change the Permalink structure. So copy the code and paste into the notepad file.
But how to upload the .htaccess file to the server?
First open up Filezilla, and then click on the “File” option. You will find the “site manager” option. Click on this option and then on the “New site”.
Click on the connect button to continue the process. Once a successful connection is established with remote server, you will see a window with two sides (left and right).
To upload the .htaccess file, locate the file from the left side of the window. Right click on the file and select “upload” to upload the file into the wordpress site. Note that before you upload, browse the right pane to find the location to upload it. Here you just browse and reach the root, then continue to upload from the left.
After you upload the notepad file, you can see the file on the right side of window. Now right click on the file and rename it as”.htaccess”. That is remove the “.txt” extension and you will get a file with name “.htaccess”.
Congratulations! Now you have created a .htaccess file and uploaded into the server using FTP. Go back to your permalink settings page and save the settings. Check out your website posts, all the posts will have the defined link structure!
If you have any doubts regarding .htaccess file creation and uploading, feel free to ask in the comments section.