Error 404-page not found

Why do I see this page?

404 means that the file cannot be found.If you have already uploaded the file, the name may be misspelled or located in a different folder.

Other possible reasons

You may receive an image 404 error because you have turned on hot link protection and the domain is not in the list of authorized domains.

If you go to the temporary url (http://ip/~username/) and receive this error, there may be a problem with the ruleset stored in the .htaccess file.You can try renaming the file to .htaccess-backup and refresh the site to see if it solves the problem.

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

Are you using WordPress?After clicking the link in WordPress, see the section on 404 errors.

How to find the correct spelling and folder

Missing or damaged files

When you receive a 404 error, be sure to check the URL you are trying to use in your browser.This will tell the server what resource it should try to request.

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

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

note, case It is important in this example.On platforms that enforce case sensitivity eExamples and EThe examples are not in the same position.

For the add-on domain, the file must be in public_html/addondomain.com/example/Example/, and the name is case sensitive.

Broken image

When pictures are missing on your website, you may see a red box on the page X The place where the image is missing.Right click X And select properties.These attributes will tell you the path and file name that cannot be found.

This varies from browser to browser, if you don’t see a red box on the page X Try right-clicking on the page, then select View page information, and then go to 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/

note, case It is important in this example.On platforms that enforce case sensitivity PNG And PNG Not the same place.

404 error after clicking WordPress link

When using WordPress, when activating a new theme or changing the rewrite rules in the .htaccess file, a 404 Page Not Found error often appears.

When you encounter a 404 error in WordPress, you have two ways to correct it.

Option 1: Correct the permalink

  1. Log in to WordPress.
  2. From the left navigation menu in WordPress, click Setting > Permalink (Note the current settings. If you are using a custom structure, please copy or save the custom structure somewhere.)
  3. 选择  default.
  4. Click on Save Settings.
  5. Change the settings back to the previous configuration (before you select the default value).If you have a custom structure, put it back in place.
  6. Click on Save Settings.

In many cases, this will reset the permalink and solve the problem.If this does not work, you may need to edit the .htaccess file directly.

Option 2: Modify the .htaccess file

Add the following code snippet To the top of the .htaccess file:

#BEGIN WordPress Service

RewriteEngine On
RewriteBase instruction/
Rewrite rule ^index.php$-[L]
RewriteCond%{REQUEST_FILENAME}! -F
RewriteCond%{REQUEST_FILENAME}-D!
Rewrite rules. /Index.php[L]

# End WordPress

If your blog displays the wrong domain name in the link, redirects to another site, or lacks images and styles, these are usually related to the same problem: you have configured the wrong domain name in your WordPress blog.

How to modify your .htaccess file

The .htaccess file contains directives (directives), which tell the server how to behave under certain circumstances and directly affect the functionality of your website.

Redirection and URL rewriting are two very common instructions in .htaccess files, and many scripts (such as WordPress, Drupal, Joomla, and Magento) add instructions to .htaccess so that these scripts can run.

For various reasons, you may need to edit the .htaccess file at some point.This section describes how to edit files in cPanel, but does not include content that may need to be changed. (You may need to consult other articles and resources for this information.)

There are multiple ways to edit .htaccess files

  • Edit files on the computer and upload them to the server via FTP
  • Edit mode using FTP program
  • Use SSH and a text editor
  • Use the file manager in cPanel

For most people, the easiest way to edit .htaccess files is through the file manager in cPanel.

How to edit .htaccess file in cPanel's file manager

Before you do anything, it is recommended that you back up your website so that you can revert to the previous version if something goes wrong.

Open file manager

  1. Log in to cPanel.
  2. In the file section, click File manager icon.
  3. Check box Document root And select the domain name you want to visit from the drop-down menu.
  4. make sure Show hidden files (point files)"Be checked.
  5. Click on GoThe file manager will open in a new tab or window.
  6. Find the .htaccess file in the file list.You may need to scroll to find it.

Edit .htaccess file

  1. Right click htaccess file. And click Code edit From the menu.Alternatively, you can click the icon of the .htaccess file and then click Code editor The icon at the top of the page.
  2. A dialog box may appear, asking you questions about encoding.Just click edit Go on.The editor will open in a new window.
  3. Edit the file as needed.
  4. Click on save Changes It is in the upper right corner after completion.The changes will be saved.
  5. Test your website to ensure that your changes have been successfully saved.If not, please correct the error or revert to the previous version until your site is running again.
  6. When you are done, you can click 关闭 Close the file manager window.