How to Locate or Create WordPress .htaccess file in cPanel




Geniuswp show

Summary: July 3, 2014ByImtiaz RayhanA.htaccess(hypertextaccess) file is a configuration file for Web Servers runningthe Apache software. This file generally controls the directory it is placed andother directories inside the parent directory.There are lots of functionality you can add or control using .htaccess file. Some basic features are :Setup a 301 RedirectPassword Protect a DirectoryRewriting URLsCache ControlIn most cases, .htaccess file comes by default with every WordPress installation. But some times it stays hidden in installation root folder.Here is the default code for WordPress .htaccess file :# BEGIN WordPressRewriteRule ^index\.php$ – [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]# END WordPressNow if you want to add some codes in your WordPress .htaccess file or you want to create a new one but you have no idea how you can do that, then you are in the right place.First I will show you how to find WordPress.htaccess file in your cPanel.How to Locate .htaccess File in cPanelGenerally, .htaccess file is already created when you install WordPress on your webhost. But the period that starts the file name will keep the file hidden within the folder.Login to your cPanel and Click on File Manager under File Managment Section.When you click on File Manger, a little Window will popup and you can find several options to choose while opening File Manager. WordPress Installation root directory is the DeafaultWordPress htaccess File Location.Make sure, you check the box which says “Show Hidden Files (dotfiles)”. Then Click on Go. Now you can see .htaccess file in your file list.Right Click on the file and Click on Edit. A new window with a text editor will open up. You can edit your .htacces file and save the changes from the Editor.You can also access file manager using FTP server. Read :How to access files using FTP Client (FileZilla).How to Create .htaccess File in cPanelIf there is no .htaccess file in your WordPress installationroot directory, you can easily create one from your cPanel and you SHOULD. Here’sHow to Create an htaccess File –Access your File Manager following above steps. Now on the upper left of your Screen you will see an Option – “New File”When you click on ‘New File’, a little window will Pop up. You can set the file name and directory here. Follow the image below.Now put .htaccess on New File Name field. Remember .htaccess is not an extension. It’s the file name. And there will be nothing before the period.It should not be something like text.htaccess. It’s only .htaccess. Now, click on “Create New File”. Reload your file manager. You’ll find the... You are listening to the topic about "How to Locate or Create WordPress .htaccess file in cPanel", if you want to read the full article, please visit https://geniuswp.com or the link in the description.