Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to redirect 404 error page to custom 404 page

    • 0
    • 1
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 286
    Comment on it

    When a visitor visits any wrong URL in the site , they see 404 not found error comes from server side by default. We can redirect the visitor from any invalid URL to any of the custom page or any page we want. For the most of the sites , we see that , they have a well designed 404 error page. When we visits any of the invalid url of their site it is automatic redirect to 404 page.

    It can easily be done. For this, first we have to develop a 404 error page we want to show. It can be in any language like html, php etc. After creating the 404 custom page we can upload it in the server and can add 1 line code in .htaccess file which is located in the root folder.

    ErrorDocument 404 "<H1>Page not found</H1>"// use this code if you want to show any error message
    
    ErrorDocument 404 /404.html // use this code if you want visitor to redirect to any custom page or 404 page
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: