We have a website based on Joomla! in the joomla directory, there are many other directories, ie:
C:\myjoomlawebsite
...joomla directories...
\myspecialdirectory
in "myspecialdirectory" there are resources that sometimes are available and other times are not available, as one would imagine, when a resource(php page) is not available, a 404 page is displayed.
What I would like to do is, "somehow" tell joomla that when the user tries to access a page located in "myspecialdirectory" and it's unavailable, it should show an article page rather than a 404.
Check this
For v1.5
if (($this->error->code) == '404') {
header('Location: /index.php?option=com_content&view=article&id=75');
exit;
}
For 1.6 & 1.7
if (($this->error->getCode()) == '404') {
Because that directory is outside of the Joomla framework, and you only want one directory to redirect to a Joomla page instead of a 404, then the easiest way to accomplish this is to use put a custom htaccess in the directory you want to redirect. You would want to add this to htaccess only in myspecialdirectory
ErrorDocument 404 /URL TO JOOMLA ARTICLE.php
对于符合标准的解决方案-在此处阅读: http : //magazine.joomla.org/component/k2/item/230
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.