0
votes

I have a Joomla site running on Apache and Ubuntu 12.04. I wanted to show a custom 404 pages to be shown when a 404 error occure. I have made necessary changes to error.php file in my template directory to redirect it to '/404' directory where I have an index.html file with many images,css and java script.

Now when accessing a non-existent page, Joomla is redirecting me to root/404 but there I get a 403 Forbidden error from appache. The 404 directory is located inside 'htdocs' directory of Joomla installation.

Additional info: 1. I don't want to convert my 404 page into a Joomla template or article. 2. I am using a Joomla AMI from Bitnami on Amazon web service

2

2 Answers

0
votes

If you redirect to a 404 page, you corrupt the error mechanism. The client will never get that 404 status, but a 200 on successful redirect to your error page.

Instead, you should modify your template's error.php to

  1. send the 404 Not Found header
  2. directly send the error page using readfile()

You might have to adjust the asset paths within your error page.

0
votes

That's totally wrong, working with static pages does not mean that you have to overcome Joomla's routing. You should either override the error Page view or use custom error pages. Take a look at Joomla's documentation.http://docs.joomla.org/Custom_error_pages Nibra was totally right about breaking the mechanism but still using a readfile() seems as an overkill.