ERROR 404 - PAGE NOT FOUND

Why am I seeing this page?

404 means the file is not found. If you have already uploaded the file then the name may be misspelled or it is in a different folder.

Other Possible Causes

You may get a 404 error for images because you have Hot Link Protection turned on and the domain is not on the list of authorized domains.

If you go to your temporary url (http://ip/~username/) and get this error, there maybe a problem with the rule set stored in an .htaccess file. You can try renaming that file to .htaccess-backup and refreshing the site to see if that resolves the issue.

It is also possible that you have inadvertently deleted your document root or the your account may need to be recreated. Either way, please contact your web host immediately.

您正在使用WordPress吗?单击WordPress中的链接后,请参见404个错误的部分。

How to find the correct spelling and folder

Missing or Broken Files

When you get a 404 error be sure to check the URL that you are attempting to use in your browser.This tells the server what resource it should attempt to request.

http://example.com/example/Example/help.html

In this example the file must be in public_html/example/Example/

Notice that theCaSeis important in this example. On platforms that enforce case-sensitivityexample andExample are not the same locations.

For addon domains, the file must be in public_html/addondomain.com/example/Example/ and the names are case-sensitive.

破碎的图像

When you have a missing image on your site you may see a box on your page with with a redXwhere the image is missing. Right click on theXand choose Properties. The properties will tell you the path and file name that cannot be found.

This varies by browser, if you do not see a box on your page with a redXtry right clicking on the page, then select View Page Info, and goto the Media Tab.

http://example.com/cgi-sys/images/banner.PNG

In this example the image file must be in public_html/cgi-sys/images/

Notice that theCaSeis important in this example. On platforms that enforce case-sensitivityPNGandpng不一样的地方。

404 Errors After Clicking WordPress Links

When working with WordPress, 404 Page Not Found errors can often occur when a new theme has been activated or when the rewrite rules in the .htaccess file have been altered.

When you encounter a 404 error in WordPress, you have two options for correcting it.

Option 1: Correct the Permalinks

  1. Log in to WordPress.
  2. From the left-hand navigation menu in WordPress, clickSettings>永久链接(Note the current setting. If you are using a custom structure, copy or save the custom structure somewhere.)
  3. SelectDefault.
  4. ClickSave Settings.
  5. 将设置更改回先前的配置(在选择默认值之前)。如果您有一个自定义结构。
  6. ClickSave Settings.

This will reset the permalinks and fix the issue in many cases. If this doesn't work, you may need to edit your .htaccess file directly.

Option 2: Modify the .htaccess File

添加following snippet of codeto the top of your .htaccess file:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# End WordPress

If your blog is showing the wrong domain name in links, redirecting to another site, or is missing images and style, these are all usually related to the same problem: you have the wrong domain name configured in your WordPress blog.

How to modify your .htaccess file

The .htaccess file contains directives (instructions) that tell the server how to behave in certain scenarios and directly affect how your website functions.

Redirects and rewriting URLs are two very common directives found in a .htaccess file, and many scripts such as WordPress, Drupal, Joomla and Magento add directives to the .htaccess so those scripts can function.

出于各种原因,您可能需要在某个时候编辑.htaccess文件。本节涵盖了如何在CPANEL中编辑文件,但不需要更改的内容。(您可能需要咨询其他文章和该信息的资源。)

There are Many Ways to Edit a .htaccess File

  • 在计算机上编辑文件并通过FTP上传到服务器
  • Use an FTP program's Edit Mode
  • Use SSH and a text editor
  • Use the File Manager in cPanel

The easiest way to edit a .htaccess file for most people is through the File Manager in cPanel.

如何在CPanel的文件管理器中编辑.htaccess文件

Before you do anything, it is suggested that you backup your website so that you can revert back to a previous version if something goes wrong.

Open the File Manager

  1. 登录到CPANEL。
  2. In the Files section, click on theFile Managericon.
  3. Check the box forDocument Root forand select the domain name you wish to access from the drop-down menu.
  4. Make sureShow Hidden Files (dotfiles)" is checked.
  5. ClickGo. The File Manager will open in a new tab or window.
  6. 在文件列表中查找.htaccess文件。您可能需要滚动才能找到它。

To Edit the .htaccess File

  1. Right click on the.htaccess fileand click代码编辑从菜单中。另外,您可以单击.htaccess文件的图标,然后单击代码编辑oricon at the top of the page.
  2. A dialogue box may appear asking you about encoding. Just clickEditto continue. The editor will open in a new window.
  3. Edit the file as needed.
  4. ClickSave Changesin the upper right hand corner when done. The changes will be saved.
  5. Test your website to make sure your changes were successfully saved. If not, correct the error or revert back to the previous version until your site works again.
  6. Once complete, you can clickCloseto close the File Manager window.
Baidu