How to create the correct htaccess for wordpress

WordPress — the most popular program to work with servers. The main file for configuring this app is .htaccess. There are many ways to build them. It is easiest to use a text editor WaordPad for writing codes in .htaccess. This will allow you to see all the code on one page and easily edit it in the future.

Wordpress

What is .htaccess?

File .htaccess is a configuration file that tells the server methods for processing the scripts and actions. It may include ways to redirect users, protected passwords, order hide some directories and etc.
Dot before the file name indicates that it is hidden. When you access the web server have the ability to see .htaccess, if your FTP client shows hidden files.
Files .htaccess are not only WordPress, but any Apache web hosting that offers this feature to save. In most cases, when you install WordPress, this file is created by default.

How to create or edit .htaccess file in WordPress

If .there is no htaccess file in the folder, you must create it manually. You can use an ordinary text editor to update or remove the content of the WP blog in the file .htaccess. An exemplary code looks as follows:
# BEGIN WordPress
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
If the server is using Filezilla FTP client, the settings you need to check the option «Show hidden files». After that .htaccess file will be visible. If this file doesn’t exist, you must create a new one using Notepad (htaccess.txt) and rename it to .htaccess. It is very important to remove the extension .txt at the end of the name so that the scripts started to work. In the Windows operating system, it is recommended to hide the file after creation, to antivirus are unable to remove it.
After renaming the file, you must move it to the root directory of WordPress and edit according to your needs.
Default .htaccess is used, the security Protocol at number 644. However, from time to time when changing Permalink and WordPress is unable to access .htaccess file, change the security Protocol on the 777 and update it. However, it is necessary to specify in the settings file that the Protocol 644 can also be applied, otherwise there are problems with security.
If you receive an error message during the download of the file, change access rights to the file to the root directory. Usually the files are in the directory: /home/syedbalkhi/public_html/directory. This folder must be shared and copy the file there. To prevent further problems, you can make backup copies of any files that are replaced.

Post Comment