I am trying to do the following - essentially redirect to the correct page if search query only returns a single result.

{if total_results == "1"}{redirect="{comment_url_title_auto_path}"}{/if}

This is working, however, it's also appending the domain to the URL, so the resulting redirect is


Is this possible at all?




That approach should work just fine.

The {comment_url_title_auto_path} variable is parsed by native EE code. So if that results in an unexpected url, you might want to check the value of that setting in the Channel Preferences.

  • Thanks - that was it - the Channel preferences had the full domain in the URL path fields. – christiaan Dec 11 '14 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.