Hi DW,
I'm trying to make a module that can redirect a user to different websites (Area), based in their browser language.
I've got everything working except getting the correct URL for my areas.
I'd like my code to redirect to the final user friendly url, to avoid Dynamicweb doing more redirects to pretty up the URL.
So far i do this:
public void Redirect( Dynamicweb.Content.Area redirArea ) { if ( redirArea != null ) { string url = "/Default.aspx?AreaID={0}"; HttpContext.Current.Response.RedirectPermanent( string.Format( url, redirArea.ID ), true ); } }
But this results in ugly URLs like /int/forside?AreaID=16 after DW does 2 redirects to pretty up url. (And it's still pretty bad :-) )
My question is therefore two part.
1. How do i get the frontpage of a given area in the API?
2. How do i build the User friendly URL in the API?
// Martin