Answer the question
In order to leave comments, you need to log in
How to serve static content to a guest?
There is a desire for site guests to give a static version of the site, without unnecessary twitching of php / database. Are there any solutions for this?
ps I know about Joomla caching.
Answer the question
In order to leave comments, you need to log in
Don't know if it will work, taken from here . The point is to use Joomla to check if a given visitor is logged in and, if not, redirect him to a static html page.
It should be in templates/your_template/index.php
$user = JFactory::getUser();
$app = JFactory::getApplication();
if ($user->id != 0)
{
// залогиненный юзер, ок
// сюда всё остальное содержимое index.php
}
else
{
// редиректим незалогиненного на статичную страницу
$app->redirect(JRoute::_('page.html'));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question