homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

ErrorDocument not working in .htaccess. Where else to look?
being redirected to home page

5+ Year Member

Msg#: 4475426 posted 4:07 pm on Jul 13, 2012 (gmt 0)

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.



5+ Year Member

Msg#: 4475426 posted 4:56 pm on Jul 13, 2012 (gmt 0)

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.


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

Msg#: 4475426 posted 6:43 pm on Jul 13, 2012 (gmt 0)

That code was generating a 302 redirect.

Is that how a default Joomla install works?


5+ Year Member

Msg#: 4475426 posted 6:58 pm on Jul 13, 2012 (gmt 0)

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved