Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » New way to get friendly url?

New way to get friendly url?

Keld Gøtterup
Reply

When using Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl() it doesn't seem to do any conversion to a friendly url. But there is a crawler which makes the url friendly in href but i do have a need to be able to make friendly url manually.

<link class="alternative-url" href="@URL" hreflang="en" test1="@URL" rel="alternate">
Gives below result in frontend
<link class="alternative-url" href="/shop/watches" hreflang="en" test1="Default.aspx?ID=198" test2="Default.aspx?ID=196&groupid=SHOP1Watches" rel="alternate">

<link class="alternative-url" href="@URL" hreflang="en" test1="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(URL)" rel="alternate"> 
Gives below result in frontend
<link class="alternative-url" href="/shop/watches" hreflang="en" test1="Default.aspx?ID=198" test2="Default.aspx?ID=196&groupid=SHOP1Watches" rel="alternate"> 


Replies

 
Lars Larsen
Lars Larsen
Reply

Hi Keld

What version are you using? I stumpled into the same problem on v9.2.6. But then I tested on v9.2.9 and on that version SearchEngineFriendlyURLs.GetFriendlyUrl() correctly returns a userfriendly url insted of "Default.aspx?ID=[pageid]".

 
Keld Gøtterup
Reply

Im now on version 9.2.10 and GetFriendlyUrl() will still not return a friendly url

 
Nicolai Pedersen
Reply

Hi Lars and Keld

This is a bug - if you call GetFriendlyUrl(string) it works with "Default.aspx?ID=123" and not with "Default.aspx?ID=123&GroupID=Group1".

I've registered this as TFS#33158 and made a fix already - will be out with the next hotfix.

A workaround is to call Frontend.Outputreplacer.ParseURL(string) instead - that should work.

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Lars and Keld

The problem TFS#33158 "GetFriendlyUrl(string) does not work with module urls" has now been fixed in version 9.2.12

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 
Keld Gøtterup
Reply

After an upgrade to 9.2.12 it still doesn't seem to work, however something has changed. Before it just returned the same URL but not now it doesn't return anything.

 

You must be logged in to post in the forum