note 113606 deleted from function.header by peehaa
| From: | peehaa@php.net | Date: | Mon, 04 Nov 2013 11:04:49 +0000 |
| Subject: | note 113606 deleted from function.header by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197433@lists.php.net to get a copy of this message | ||
Note Submitter: BenClay
----
For Joomla! users. Internet advice for creating your own 404 page often suggests you add the
following line to your error handler to redirect to a custom page:
<?php
header ('Location: /index.php?option=com_content&view=article&id=123') ;
?>
(where id=123 identifies the menu item for the custom page).
This works but doesn't create a nice URL and also exposes the Joomla! nature of the site
through use of index.php with the GET parameters.
If you have search engine friendly URLs turned on, you can use a much nicer URL in the header:
<?php
header ('Location: http://mysite.com/page-not-found') ;
?>
(where page-not-found is the menu alias for the page you want to display).