Welcome to WebmasterWorld Guest from 54.147.220.66

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

ErrorDocument not working in .htaccess. Where else to look?

being redirected to home page

   
4:07 pm on Jul 13, 2012 (gmt 0)

5+ Year Member



Greetings,
I need some help troubleshooting an issue. (I am guessing) when our site was originally set up it was decided that page not found errors would be sent to the home page instead of an error document. I am wanting to change this and handle it properly. However, the site does not seem to respond to ErrorDocument directive within .htaccess (it is in the / of the site).

Currently I have the following line:

ErrorDocument 404 /404.php

However this is being ignored and users are still being sent to the home page. I have tried looking at headers using plugins, but of course it only returns the 200 OK for the home page that does load.

So where do I go from here? Is there a way to trace this to find out what file has the directive that is forcing people to the home page? Open to suggestions.
4:56 pm on Jul 13, 2012 (gmt 0)

5+ Year Member



Ok, wanted to follow up to say that I figured it out. This was for a joomla site and I needed to go in and edit /templates/example/error.php as there was the following line:

<?php header("Location: /"); exit; ?>

Just FYI in case someone else needed it.
6:43 pm on Jul 13, 2012 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



That code was generating a 302 redirect.

Is that how a default Joomla install works?
6:58 pm on Jul 13, 2012 (gmt 0)

5+ Year Member



I am not sure actually as I did not originally install the site. I want to say that the home page redirection was done by the company that originally installed the site. I can verify that by looking at a vanilla joomla install.