WordPress topic modification causes the entire site to be inaccessible at 404, wordpress404

Source: Internet
Author: User
Tags ftp client

WordPress topic modification causes the entire site to be inaccessible at 404, wordpress404

This afternoon, I found some bugs in the theme of my WordPress website www.hainter.com and decided to modify it.

Since the theme was not designed by myself, it was modified on the basis of the Ality theme of zhiyubird, so there was no in-depth research on each file in it.

One afternoon after the change, the local site implemented by USB webserver was debugged and uploaded to the site using an FTP client, directly replacing the existing topic. After the page is refreshed, the page cannot be accessed, and the browser displays Error 404.

When this error occurs, the first response is a network problem, because it is a foreign server, and occasionally 404 is normal. If you refresh the page several times or 404 times and open Baidu normally, it means that you can access the Internet. This 404 error has never occurred before. Open cmd and enter ping hainter.com to find that the ping is successful, and the FTP can also be connected. It seems that it is not a network problem.

Then I tried it in the Chrome browser of the mobile phone and found that it could not be opened, prompting that the content could not be recognized. The computer problem was ruled out this time.

The problem is probably due to the topic that has just been changed. The home page cannot be opened. It may be because some program code on the home page is incorrect, and the address of other pages is entered. If you enter the website background address directly, the website cannot be opened, and the displayed error is the same. In general, if a theme error occurs, at least the background will not be affected. After all, the background interface is built on WordPress and does not require too many dependencies.

No way, you can only solve the problem through FTP. Rename the currently used topic folder, and change another topic to the folder Name of the current topic. The result will be accessible as soon as it is refreshed.

As the local debugging of the topic is normal, it is reasonable to say that there should be no problem with the topic, which may be an FTP transmission error. I re-uploaded all the theme files and compared the file size. On the theme settings page in the background of the website, Click Preview topic to preview other theme items. However, the whole page does not have any theme modified today.

I found WordPress theme 404 in a circle on the Internet, but the result is that I added the 404 page to the WordPress theme, but I did not find the desired result.

Because all pages cannot be opened, it is suggested that the question may be in some public files, such as header. php and footer. php. Because there are versions that can be used before modification, we found a folder content comparison software Beyond Compare from the Internet to Compare folders. Because there are many files in the topic, it was found that many files were modified in the afternoon, and it was not easy to check which files were faulty at once.

We decided to find the error location by directly replacing the file. Open the DEBUG mode of WordPress (modify define ('wp _ debug', true) in the wp-config.php) and set it to the topic version available before the change. Each time you upload a new version of a number of theme files that overwrite the old version, and refresh the page for access, these files will be excluded. Finally, the error file is located to ten files in a sub-folder (that is, these ten new files are overwritten and the website cannot be opened ). Then, replace the old version with the new version one by one. Finally, a file is replaced with the old version and can be accessed again, so the problematic file is found.

Compared to the two versions of this file, there are only a few very short lines. The only difference is that the encoding is different. The original file is ANSI encoding, I opened with SublimeText found that the display is garbled (Sublime default use UTF-8 encoding display), it is converted to the UTF-8 encoding with Notepad ++ save, in Sublime, no garbled characters are displayed. I didn't care about this. I think the encoding should be okay. Besides, other files are also UTF-8 encoded.

This specific look, found that other files in Notepad ++ show all the UTF-8 without BOM format, and this file is converted to UTF-8 format. After modifying the encoding format and uploading it again, everything went right.


It is normal to use it locally and cannot be used on the remote server. It may be the reason for the server configuration. As a result, some people may encounter this problem, which can be used as a reference.

This article first self personal homepage, reprinted please indicate the source http://www.hainter.com/wordpress-theme-404

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.