Linking to another website procedurally Hopefully this is a straightforward question.

I'm procedurally building nodes as I walk an XML feed, and am importing them into a production server.  I'm having issues importing node aliases, so I thought I could simply create links to the nodes as they will be on production (pathauto will take care of auto-aliasing them).

When I fill the href attribute of my link, instead of pointing to my website it points to my local server (it seems to be auto-changing my link).

I'm building my link like this:

$link = 'http://example.com/content/' . $current_node['name'];
$name = $current_node['name'];


and then assigning in my string

$output = "&lt;a href='" . $link . "'&gt;" . $name . "&lt;/a&gt;":


However, as I mentioned, it ends up pointing local instead of direct to my outside node.
If you're creating links, use l().

$url = 'http://example.com/content/' . $current_node['name'];
$output = l($current_node['name'], $url, array('external' =&gt; TRUE));