Creating and customizing your site is a pleasant moment for webmasters. But sometimes they may encounter an error. What it means and how to eliminate it, you will learn by reading this article.
The content of the article:
- Причины ошибки Internal Server Error 1 Causes of Internal Server Error
- Где в панели администратора найти .htaccess 2 Where in the admin panel to find. Htaccess
- Устранение ошибки сервера 3 Troubleshooting Server Error
- Другие способы устранить The server encountered an internal error 4 Other ways to fix the server encountered an internal error
- Как создать черный список в .htaccess 5 How to create a blacklist in .htaccess
Causes of Internal Server Error
. This translation error is: internal server error . The system detected an internal failure or incorrect settings and was unable to generate a request. This means that some settings of the loaded engine or other files are incorrect, which is why an error occurs. . One of the common causes of this server problem is the .htaccess file errors. This is an additional file to provide specific commands for servers, in particular Apache.
Many webmasters manage to solve the “Internal Server Error - the server error” problem by examining this file carefully. It may indicate the wrong domain or even denied access to the site. The .htaccess file allows you to: change settings for the entire site, protect certain directories with a password, create blacklists from a URL, allow access only to selected sites, and much more.
See also: Error Error 503 Backend fetch failed what to do .
Where in the admin panel to find. Htaccess
In order to edit a file, you need to find it in your admin panel. . On a hosting that has cPanel and in the WordPress engine, this file is located in the public_html directory.
- Select a directory and locate the file.
- After that, select "Edit" in the context menu. It may be in hidden files.
- You need to display them, find the "Settings" button and change the "Show hidden files" item.
- If not at all, you can create it yourself. Click the File button in the file manager at the top and create a .htaccess file.
I recommend to read: On this page a script error - Solution .
Server Error Correction
If you carefully examine the .htaccess file, you can determine why the message appears. Sometimes users manage to determine for sure that there is an error in the .htaccess file. To do this, you need to remove all the contents from it and save it to another text file, so as not to lose. After that, you need to open the site, if the error does not occur, then the reason is in the file.
To begin, let's try to find the file parameters that may cause this error. Find the following lines in your .htaccess file:
They need to be commented out. To do this, at the beginning of the line that contains these parameters you need to put a hash sign - #. The commented line will look like this: # php_value. A space must be inserted between the grid and the next character. For WordPress, you may still need to comment out the following options: SecFilterEngine Off and SecFilterScanPOST Off.
Perhaps in your file you need to set the encoding, try to comment out the following line: AddDefaultCharset WINDOWS-1251. Try changing to UTF-8. You also need to find (if any) in the file the line # RewriteBase / and remove the lattice character from it. Check the links in the text. Htaccess, perhaps they are incorrect.
Interesting: ERR_CACHE_MISS - how to fix the error?
Other ways to fix the server encountered an internal error
Find AllowOverride All in your .htaccess file. If there is a grid (#) here, remove it.
- You must also verify that the following VirtualHost entry exists for the domain. As an example, you can see in the screenshot what the entry looks like;
- Make sure that the configuration file contains the hostname of the server (usually specified as a domain or IP address);
- Try to deny access to all incoming IP addresses in order to verify the operation of .htaccess - Deny from all.
How to create a blacklist in .htaccess
You can create your own list of IP-addresses that can not get to your site. To do this, find the .htaccess file and edit it. The following code that will block addresses must be entered from a new line.
- You can put a comment sign at the beginning of the code to explain for yourself what the future is for. For example, # Blacklist for boors;
- The first line allows visiting for all addresses - allow from all;
- The following code will block the specified address - deny from86.164.01;
- Add another IP address - deny from484.015.44.
This list can go on forever. If you do not know what the address of annoying commentators is, you can search them in the logs of your server. Different engines have their own methods for determining addresses. This can be done by third-party PHP scripts. A universal way for all engines to determine the IP address is to find the corresponding section "Server Logs". On the cPanel platform, this is the "Visitors" section. You can use the online configuration file checker service to correct the internal server error.