Do not allow {{prefix:pagename}} to transclude foreign templates/pages, rather look for a local page in the template namespace.
{{prefix:pagename}}