Rated 4.8 out of 5.0 for Aresourcepool by 600 clients on over 1500+ projects.

AResourcePool Blog

A Collection of Articles on Web Development, Mobile App Development, UI/UX Design and More

How to create.htaccess file in WordPress?

Tags: , , , , , ,

The .htaccess is a distributed configuration file. In WordPress, this file is used to manipulate how Apache serves files from its root directory and subdirectories.

In this blog post we are going to share how to create and edit .htacesss file in wordpress. It can be created either manually or by using Yoast plugin or using FTP Client Filezilla.

WordPress is open source content management system (CMS) that supports various extraordinary features to have all over control on every activity or behavior of website. WordPress offers one of the best features to create or edit .htaccess file for website optimization.

Uses of .htaccess file: –

1- This file is used to enable or disable safety features.

2- The .htaccess file is used to change the behavior of handling search engine bots.

3-It is used for write/ re-writes URL redirections.

4- This file acts as safeguard for website spammers.

5-It is also used to activate Gzip compression.

6-It is easy to change etag functions by using .htacess file.

How to create .htaccess file in WordPress

First time, when you choose permanent website url structure, WordPress automatically creates .htaccesss file. But sometimes WordPress does not generate .htaccess file automatically due to some file read/write/create permissions at hosting server end.

Here we have shown an example for AResourcepool Website.

.htaccess file in wordpress

Steps to manually create WordPress .htaccess file in WordPress

There are listed following steps:

1-Simply create a text file on your computer.

2- Copy the following code in that file

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]


# END WordPress

3- Rename the text file extension from .txt to .htaccess

4- Now upload .htaccess file in website root directory by using any FTP Client as FileZilla or by directly using hosting C panel file manager.

For Example:

Path: /home/yourweb/public_html/.htaccess

It is also easy to edit .htaccess file by using WP HTAccess Editor Plugin.

AResourcepool facilitates Hire WordPress Developers Services for website development, .htaccess file updation, plugin development, website maintenance and more.