How to create htaccess file Manually in WordPress

How to create htaccess file Manually in WordPress

How to create htaccess file Manually in WordPress

How to create htaccess file Manually in WordPress-: Do want to WordPress create htaccess file but do not know How to do it? Keep reading this post I will explain in detail How to create an htaccess file manually in WordPress.

What is htaccess File-:

How to create htaccess file Manually in WordPress

The name of the .htaccess file is short for “HyperText Access.” It’s a configuration file that determines how Apache-based servers interact with your site. In simpler terms, .htaccess controls how files in a directory can be accessed. You can think of it as a guard for your site, in that it decides who to let in and what they’re allowed to do.

By default, a .htaccess file is typically included in your WordPress installation. The main purpose of the .htaccess file is to improve security and performance, and it also enables you to override your web server’s settings.

You’ll most likely find your .htaccess file in your site’s root directory. Since .htaccess applies to both its own directory and any subdirectories within that main folder, it impacts your entire WordPress site. It’s also worth noting that the .htaccess file does not have a file extension. The period at the start is simply to make sure the file remains hidden.

If your website hosted on Nginx server you will not have .htaccess file. In Nginx, you will use the try_files directive to accomplish the same thing.By default, the configuration file is named nginx.conf and placed in the directory /usr/local/nginx/conf,/etc/nginx or /usr/local/etc/nginx

Some of the features of the .htaccess file include the ability to password protect folders, ban users or allow users using IP addresses, stopping directory listings, redirect users to another page or directory automatically, create and use custom error pages, change the way files with certain extensions are utilized, or even use a different file as the index file by specifying the file extension or specific file.

How to create an htaccess file Manually in WordPress-:

Step.1-: Create a text file in Notepad on your computer.

Step.2-: Copy and Paste below code in that file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]
</IfModule>
# END WordPress

Step.3-: Rename the file extension of your text file from .txt to .htaccess. Now your .htaccess file is ready.

Thanks for reading…“Pardon my grammar, English is not my native tongue.”

If you like my work, Please Share on Social Media! You can Follow WP knol on Facebook, Twitter, Pinterest and YouTube for latest updates. You can Subscribe my Email Newsletter to get the latest updates via Email. You May also Continue Reading my Recent Posts Which Might Interest You. 

Share the Knowledge!
  • 152
  • 5
  •  
  •  
  • 2
  •  
  •  
  •  
    159
    Shares
Amar Patel on FacebookAmar Patel on PinterestAmar Patel on TwitterAmar Patel on Wordpress
Amar Patel
Hi, I am Amar Patel from India. Founder, Author and Administrator of wpknol.com. I am a Simple Average Man who Loves life and Love living life.Professionally I am a Mechanical Engineer. Apart from my Job, I Love to write the things around WordPress WordPress CMS.
Enter your email address: Delivered by FeedBurner
Follow us on Social Media