How to setup .htaccess file for a website through Cpanel

How to setup .htaccess file for a website through Cpanel
How to setup .htaccess file for a website through Cpanel

What is .htaccess file? Here we will know about How to setup .htaccess file, It is a configuration file that controls how the web server responds to various requests. .htaccess means [Hypertext Access].

You can see .htaccess file in the file manager or .htaccess file is hidden in the file manager because all folders that start with a dot(.) in FileManager are hidden by default. .htaccess file is a very important file. This file lets you control many aspects of the Apache server.

.htaccess file

How to view .htaccess file if it is hidden. By Cpanel?

Cpanel gives you an easy way to access or create

  • Go to your hosting Cpanel.
  • Open the file manager in your Cpanel file section
  • The File-manager will open in the next window. Click the setting button on the top right
  • A pop-up will open, check the show hidden files checkbox and click the save button
  • . Now, the file manager will show all the hidden files, Right-click on file and select to view or edit
  • If there is no .htaccess file, then you need to make one
  • To create go to Filemanager homepage, then click on Public_html Folder

Here you need to create a .htaccess file:

  • Now Click the File button at the top left.
  • In the new window, enter the file name .htaccess click create new file
  • Select to edit. or click the file to select edit and click on edit
  • When the Text editor dialogue box appears make sure utf-8 is selected for encoding, and then click edit.
  • The text editor will open in a new window, you see a blank window cause it’s a new file so you need to edit the redirection or other codes that you have.
See also  How to create and maintain MySQL Database (Cpanel Guide)

How to Setup .htaccess file using FTP(file transfer protocol)?

  • Open FileZilla app and log in to your web space using FTP
  • Double-click public_html to list your website files
  • Select .htaccess, right-click and select View/Edit
  • Enter your new code. Save the file once you have finished editing

Subscribe to our Newsletter:

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *