Try this function
public string GetPageUrl(string friendlyUrl) {
//current web
SPWeb web = SPContext.Current.Web;
//check if the current web is a publishing weg
if (PublishingWeb.IsPublishingWeb(web)) {
//get the pages list id
Guid listId = PublishingWeb.GetPagesListId(web);
//retrieve the pages list
SPList pagesList = web.Lists[listId];
//itterate trough the pages
foreach (SPListItem item in pagesList.Items) {
//retrieve the terms used for the navigation (this can be multiple terms)
IList<NavigationTerm> terms = TaxonomyNavigation.GetFriendlyUrlsForListItem(item, false);
//check if the pages has terms associated with it
if (terms.Count > 0) {
//use the GetResolvedDisplayUrl to retrieve the page friendly urls
if(terms[0].GetResolvedDisplayUrl(string.Empty).ToLower() == friendlyUrl.ToLower())
return item.File.Url;
}
}
}
return friendlyUrl;
}