{# Look for the user #} {% set user = craft.users.username(username).one() %} {# Abort if no user was found with that username #} {% if not user %} {% exit 404 %} {% endif %} {# Render the user profile page #} {# ... #}