1

Currently, I have Strict URLs disabled in my global preferences so that if somebody tries to access a page that doesn't exist, it will just bring them to the homepage. However, this only works on pages that are in the root of the folder structure. For instance if I go to http://mysite.com/nonexistant it will reroute me to the homepage as it should, but if I go to http://mysite.com/about/nonexistant it presents a blank white page.

I tried enabling Strict URLs and specifying a 404 page(because this will be what I do eventually) and the same issue occurred. http://mysite.com/nonexistant shows me my 404 page, but http://mysite.com/about/nonexistant displays a blank white page.

Any ideas on how to fix this?

Thanks in advance!

3
  • 1
    Do you have an 'about' template group or template within the default group? What happens at mysite.com/abc/def ? Nov 21, 2013 at 23:39
  • Yes, I have an "about" template group. abc/def redirects me to the homepage. Thanks for the response!
    – APAD1
    Nov 22, 2013 at 16:19
  • So it appears that the 404 page will display as long as their isn't a template group in the URL. Does anyone know how I can make the 404 page display for all nonexistent pages?
    – APAD1
    Nov 22, 2013 at 20:24

1 Answer 1

2

http://mysite.com/about/non-existent will load the http://mysite.com/about template.

This is because EE looks at that second segment automatically for a number of things... if there isn't a template name there it will try to load an entry with that url_title into the /about template.

To stop this behavior, add this into the /about template:

{if segment_2 != ""}
    {redirect="404"}
{/if}
1

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.