Custom 404 page integration with .htaccess and their SEO impact
If some visitor opens the url that doesn’t exist on the website then that url show 404 page.
The best way to handle customers request to show a customized 404 page on the website and then link 404 page with website through .htaccess file when someone opens a link that is not available to the website.
Calling 404 page (custom error page) with .htaccess file
We can associate 404 page (custom) error page through htaccess file by just writing a single line into our htaccess page
ErrorDocument 404 http://www.cutehits.com
The same code will be written to redirect users to home page of website through .htacces file
Make sure after adding the above errordoc in your .htaccess file you are getting proper redirect.
For 404 pages you must get eithger response header 404 or 301 (if you want to redirect user to home page of website). Click on Website Redirect Checker to check your website redirect.
Like below
If you see HTTP/1.1 302 then you must need to change it so that it should show either HTTP/1.1 301 or HTTP/1.1 404 .
Chaget 302 redirect with 301 redirect using htaccess file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . http://www.cutehits.com [L,R=301]
Chandra Shekhar
Latest posts by Chandra Shekhar (see all)
- Best practices for micro service design - January 23, 2022
- Spring Boot - January 23, 2022
- Java - January 23, 2022
Recent Comments