The following is within the index template on a site in production:
{% set domain = craft.request.getServerName() %}
{% if domain starts with 'subdomain' %}
{% include 'subdomain/index' %}
{% else %}
{% include 'homepage' %}
{% endif %}
It works without any problem on that server. I've just copied the site over to a another server for development, but that same code seems to be responsible for a 500 error. The following works, so I think it's to do with Twig's start with
conditional:
{% set domain = craft.request.getServerName() %}
{% if domain == 'subdomain.domain.com' %}
{% include 'subdomain/index' %}
{% else %}
{% include 'homepage' %}
{% endif %}
I'm assuming it's a PHP setting - does anyone know which?
craft/storage/runtime/logs
files or on your web server's error logs depending on if your web server or Craft generated the 500.