1

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!

1
  • 1
    Please, add a sample of your code and the name and directory of the 404 template. Looks like the redirect isn't working.
    – Sobral
    Aug 15, 2013 at 18:14

2 Answers 2

2

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

1

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.

1
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.