How to edit files in C Panel

Imagine that you decide to change the look of your site template or add a series of features to your site template, in these cases when you get in touch with site design experts and ask them to guide you, for example, the color or size of one Change the template parts of your site, they tell you to go inside your site host and enter the template css folder and open the style.css file and add these few lines of code to the end of this file or the codes in Change the x line to make your site look the way you want it to, or for example your site has encountered an internal server error or the same error 500 and to solve this problem you are told to log in to your site and edit the .htaccess file And add some code to it to solve the problem of your site, or for example, when you change your site host and migrate to another hosting company, you need to enter the Joomla configuration.php file or wp-config.php WordPress and specify the new database of your site Enter the one you created in the new host into these files to activate your site. And in many other cases, you need to edit your files online and immediately see the result of the Change in the site’s demo at that time. In this tutorial video, we have decided to teach you how to edit files in the C panel.

Files can be edited in C Panel through three tools:

You should know that, in general, C-panel has three types of editors, each of which has different uses, and now we have decided to explain the use of each of them to you:

  1. The text editor allows you to edit all coded files with this editor, which is easily accessible through the C-Panel file manager.
  2. Code Editor Editor that with this editor can edit all coded files in formats such as .html, .css, PHP, and .txt. This tool has more features for editing programmed files than the previous editor.
  3. HTML Editor, which can only edit files in HTML format with this tool, has complete facilities for editing Html files that can do a lot of things.

The important thing to keep in mind when editing files is that there are only editable and modifiable files on which the edit access level is pre-set; otherwise, if a file does not have an edit access level Well, you can not edit it online, for example, access level 644 is a good access level that if it is set on a file, you can easily edit that file, for more information in this regard, please video Learn how to change the access level of files in C Panel in full.

How to edit files in file manager

To edit the files inside the C-panel host, please first log in to your site’s C-panel host by learning how to log in to the C-panel, and from the files section, click on the file manager to enter this section. How to edit files in C PanelYou are now in the home section of your host file manager. Here is the location of your hosts’ basic and structural files, so you should not edit any of the files in this path. All you have to do to edit your files is to enter the public_html section to enter this section. Please double-click on its icon from this section to enter here. How to edit files in C PanelThe contents you see in this path are the files of our WordPress website, and we have decided to teach you how to edit them. Before making any edit, you can right-click on the file you want and click the view option to First look at its contents and see if this is exactly the file you decide to edit or not.

How to edit a file through the edit tool in C Panel

Now, for example, we want to edit the wp-config.php file of our site and put the specifications of the new database of our site in this file. First, we right-click on this file, select the view option, and look at the contents inside. We put this file to find out if this file needs to be edited or not. Our site address is mizbanfatv. Ir, and if we enter this address in the browser and press Enter, we will see an error in communicating with the database according to the screen image. How to edit an .htaccess fileThis is because the specifications of our databases are not properly placed in the wp-config.php WordPress file, so we go back to the file manager and right-click on this file. We can edit this file with a simple edit editor. And by code editor, because we do not want to do too hard work, so we click on the same edit editor and do our job with it, How to edit an .htaccess file on a hostAfter entering this file, we put the name of our database in this section, and we put the username of our database in this section, and we also put the password of our database in this section, then we notice from above that encoding our file on utf -8 and then click the save changes button to save the changes, Edit site files in C PanelNow, if we enter the domain address of our site in the browser again and press the Enter key, our site will be displayed and it will not give any more errors.

How to edit a file through the code editor tool in C Panel

Now, for example, imagine that we decide to change one of the template sections of our site and tell us that to do this we have to go inside the style.css template file and on line 4521 change the font value from 31 pixels to 36 pixels Well, now if we want to do this with a simple edit editor, we have to go through a few thousand lines of code to find that code, but inside the code editor tool that is designed for this, we are not going to bother so much, as example We now enter the template folder of our site and find the style.css file and right click method and click the code editor button, site codes on hostsAs you can see, because the number of codes in this file is very large, it may take a while for the file to be fully loaded. After loading the contents of the file with this editor, as you can see, the line number of each line of code is inserted on the left side. , So now we go easily and find line 4521 and from here we convert the number 31 to 36, for example, then we raise the save changes button from there to save the changes. coded files in C Panel

How to edit an html file through the html editor tool in C Panel

Now if you have an html file and you decide to edit it online, you can use a professional html editor, for example, as you can see, we now have a file here called readme.html and if we want the result Let’s see the executable of the file, go and type in the browser and the address of the file mizbanfatv.ir/ readme.html and as you can see, this is a very simple html page that was composed of different parts and the WordPress logo is above it, How to files in C Panel