Why is Drupal prepending 'node' to the link URL? I am working on a Drupal site. My issue is that when a link is created either by using the url() or the base_path variable, it works OK on local development environment. But when the very same code is put on the server, the URL prepends node string in the path . 

E.g. the path is &lt;drupal site&gt;/latestnews. The generated path is &lt;drupal site&gt;/node/latestnode and when clicked, it shows the page not found error. However I would like to mention that the links work fine (i.e generate correct path) when clicked from the home page. 

Any help would be appreciated. If it can help, am using Pantheon hosting for testing.

UPDATE

menu link generation code is as under. (the  code can show my proficiency in drupal :) )

function GetMainMenuItems()
{
    $menu = menu_tree("main-menu");

    $keys = array_keys($menu);

    $count = count($keys);

    unset($keys[$count-1]);
    unset($keys[$count-2]);

    $items = array();

    foreach ($keys as $key) {
        $temp = array(
            'title' =&gt; $menu[$key]["#title"],
            'url' =&gt;   url($menu[$key]["#title"])
        );
        $items[] = $temp;
    }
    return $items;
}
the issue (for the current scenario) turned out to be hardcoded link in the page.tpl.php file. the front page was working ok as it had its own custom template but other pages were using the page.tpl template for rendering the links. 

seems that sometimes small issues goes undetected. :) . just leaving this answer so that someone else may also look into such a possibility in their case.