Ticker

6/recent/ticker-posts

Advertisement

Responsive Advertisement

How to Create 404 Error file for PHP,Wordpress and HTML website


How-to-Create-404-Error-file-for-PHP,HTML-and-Wordpress-Website

What is mean by 404 errors?
  • If anybody enters wrong URL, the page is not found is called 404 error. It is rectified by .htaccess file.
  • Suppose when you open any page in your site, if you enter the wrong URL then we get 404 error

      www.digitalvishnu.in\contactus.css --- wrong URL. Then you may get a 404 error.
  • It means that the website not used 404 error syntax.
  • Sometimes you may enter the wrong URL it will go to the Home page. i.e., that website used 404 error syntax.
  • The file name is called .htaccess it is a hidden file. It varies depends on PHP, Wordpress and HTML site.
  • In WordPress, we may use plugin.
  • The File will save in the extension like .htaccess

 How can we create the 404 error file? How can we upload it?
In WordPress
1. Login Cpanel.
2. Go to File Manager.
3. Click public_html.
4. Check .htaccess is available or not. (Hyper Text Access -- .htaccess)
5. Click the setting option.
6. Click show the Hidden file.
7. Right-click the .htaccess file.
8. Click the Edit option.
how to write 404 error syntax for html site

how to write 404 error syntax for php site

how to write 404 error syntax for wordpress site

9. Copy the code (PHP or HTML or WordPress) and paste in the head section or Use a 404 plugin.
10. Click save changes.
11. Now we enter wrong URL in Google search box then it can direct to the home page.
12. Suppose if we want to direct to contact us page means change index.php into contact us.php.

How to Create New.htaccess file?
1. Click +File on the public_html page of Cpanel.
2. Copy and paste the code
3. Save it as .htaccess.txt

How to Create New.htaccess file for blogger
  • In blogger 404 error file already pre-loaded
  • If you type the wrong URL it will show the message “Sorry, the page you were looking for this blog does not exist” and below the display message Home anchor text enabled

So, if you type wrong URL automatically redirected to the Home page. This is a default setting by a blogger.

But we can change the display message by following Method:
1. Click setting.
2. Click Search Preference.
3. Click edit option for Custom page Not Found.
4. Type the following Message “Page was not found Click Home Page Below”.
5. Click Save changes.
6. Refresh the website URL.








Post a Comment

1 Comments