[英]CMS Joomla: How to clear joomla cache without using admin pages?
[英]Multiply Index pages using Joomla
我已经使用Joomla创建了我的网站。
我需要一个免责声明页面,前端用户才能看到网站的其余部分。
我创建了一个新的“ index.php”页面,其中包含免责声明信息以及指向该站点的链接-我将原始php文件重命名为“ index1.php”
“ Index.php”视图,但该链接不起作用。 我的代码似乎确实正确。
有什么建议吗?
您不能只在joomla中重命名index.php
。 它是您网站的入口,它会初始化/路由/运行您的joomla应用程序。 因此,相反,您应该修改index.php
,使其能够识别第一次访问并将用户重定向到正确的页面。
将您的条款页面命名为first-time.php
并按如下所示修改index.php
:
<?php
if (!isset($_COOKIE['firsttime']))
{
setcookie("firsttime", "no", /* EXPIRE */);
header('Location: first-time.php');
exit();
}
else
{
// Set flag that this is a parent file.
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
if (file_exists(dirname(__FILE__) . '/defines.php')) {
include_once dirname(__FILE__) . '/defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE.'/includes/defines.php';
}
require_once JPATH_BASE.'/includes/framework.php';
// Mark afterLoad in the profiler.
JDEBUG ? $_PROFILER->mark('afterLoad') : null;
// Instantiate the application.
$app = JFactory::getApplication('site');
// Initialise the application.
$app->initialise();
// Mark afterIntialise in the profiler.
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
// Route the application.
$app->route();
// Mark afterRoute in the profiler.
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
// Dispatch the application.
$app->dispatch();
// Mark afterDispatch in the profiler.
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
// Render the application.
$app->render();
// Mark afterRender in the profiler.
JDEBUG ? $_PROFILER->mark('afterRender') : null;
// Return the response.
echo $app;
}
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.