Moved kirby to subdomain -> page offline


i changed the way i access my kirby installation from http://domain.tld to http://subdomain.domain.tld. Now i cannot access my kirby anymore, i get an error saying “This page is currently offline due to an unexpected error. We are very sorry for the inconvenience and will fix it as soon as possible.”.

How can i change the entrypoint for my kirby installation?


Kirby normally doesn’t care about the domain. Is there maybe something in your .htaccess ?

Anyway you could enable debug mode in your config.php file to get some more details about the error.

c::set('debug', true)

Maybe you have set a URL in your config.php?


c::set(‘URL’, ‘https://subdomain.domain.tld’)

leads to the same error.

No, you don’t have to do that. I was just wondering if you had a leftover from the old url.

Have you enabled debugging in your config as suggested by @rasteiner? That should give you more information as to what is causing the error.

yes, and i get this error:

Too few arguments to function e(), 1 passed in /homepages/26/d692322575/htdocs/uniformis/cms/site/snippets/footer.php on line 10 and at least 2 expected

but i did not change this file.

Could you please post the code from line ten?

As the error message says, the e() helper expects two arguments:

<?php e($site->language() == $language) ?>

the complete code block:

<?php foreach($site->languages() as $language): ?>
      <?php e($site->language() == $language) ?>
      <a href="<?php echo $page->url($language->code()) ?>"><?php echo html($language->name()) ?></a>
      <?php endforeach ?>

Well, yes, there is no second argument, only a condition.

The e helper works like this:

<?php e($site->language() == $language, 'Yes, the languages are the same') ?>

With what should be printed if the condition is true within the parenthesis, separated by a comma.

If you want to show the link only if the condition is true, you would need an if statement here instead.

<?php foreach($site->languages() as $language): ?>
   <?php if($site->language() == $language): ?>
    <a href="<?php echo $page->url($language->code()) ?>"><?php echo html($language->name()) ?></a>
  <?php endif ?>
<?php endforeach ?>

i made this correction, but my error remains. Still cannot load ths site.

What do i have to backup, if i whould make a new installation?

Oh, sorry, I forgot a colon in the if-statement, corrected the code above.

Stop, forgot the : after <?php if($site->language() == $language), now it works, my page loads.


but now, my language switch does not work anymore…

What does “does not work anymore” mean? It doesn’t appear at all, the link doesn’t switch to the other language?

Only “Deutsch” is there… English is gone? i will first investigate this and then come back to this thread.

Thanks so far.

Well, yes, but that is exactly what the code does, it only displays the link for the non-current language. Maybe you wanted to do something else with your original e() helper code? Maybe add an active class to the current language link?

Have a look at the example language switch in the docs:

Like this?

<?php foreach($site->languages() as $language): ?>
  <a class="<?php e($site->language() == $language, 'active') ?>" href="<?php echo $page->url($language->code()) ?>">   
    <?php echo html($language->name()) ?>
<?php endforeach ?>