Nothing more than this little line of code:
$homeUrl = $this->url(
array(/* your route params */),
array('force_canonical' => true)
Of course, you need to call it within a code zone where you can invoke the URL helper. What you see above, assumes that you are in a .phtml file invoked by a controller’s action.