Wrong friendly url

Vote:
 

I have a multiple language site with Friendly url enabled. The site is running CMS 5 SP2. The problem i have is related to friendly urls. I generate a RSS feed and I therefore need to manually generate the urls in the feed as friendly. I use the following lines of code:

string linkUrl = SiteConfiguration.Host.AbsoluteUri + pd.LinkURL;
UrlBuilder url = new UrlBuilder(linkUrl);
EPiServer.Global.UrlRewriteProvider.ConvertToExternal(url, pd.PageLink, UTF8Encoding.UTF8);
return url.Uri.AbsoluteUri;
I guess the problem is that the ConvertToExternal method generates a faulty url when the language is set to anything else than the original language. A generated (faulty) url:

http://website/sv/Sitename/about/Press-releases/?releaseid=1107000,

but it should look like this: 

http://website/sv/om/Pressreleaser/?releaseid=1107000

The problem only occurs in our stage environment. Everything works ok when I run the same code on my local environment. Both are SP2.
 
Why this difference between the two environments? 
#21601
Jul 02, 2008 14:20