I read this article and setup my single entry pages with the 404 redirect conditional. I also setup the 404 page in the CP and set Strict URL's to YES. When I try and go to a broken link I do get redirected to the 404 page, but it still has the broken URL in the browser. I have analytics installed on the 404 template but I'm wondering how this will show up in Google Analytics. I want to be able to see what URL people are visiting and getting the 404. Any help? Thanks!
2 Answers
For SEO purposes, I don't think it's a good idea to return a 301 redirect when you want to return a 404 error.
When you do {redirect="404"} then EE serves the 404 template with a proper HTTP 404 status response.
When you do {redirect="404/index"} then EE responds with a HTTP 301 status redirect header.
Google Analytics and Webmaster Tools track when a URL responds with a 404 error, so that shouldn't be a problem
On our EE site, we are doing any forced redirects with this code:
{redirect="sorry/index"}
The URL changes accordingling to the 404 Error Page.
-
I had {redirect="404"} instead of {redirect="404/index"}, it's redirecting to the 404 page with the 404 url now. Thanks for pointing out my oversight! Aug 15, 2013 at 21:29