November Happy Hour will be moved to Thursday December 5th.

IsFurlEnabled

Vote:
 

Hello,

I'm hoping this is a quick and easy one, I just haven't been able to find the answer (yet!).

I need to write a meta data tag to a page with the full URL of the page e.g. http://www.site.com/AboutUs and found some code to do this as follows:


    /// Get the pages external URL
    ///
    /// <param name="page">
    /// The pages external URL
    public static string GetExternalUrl(this PageData page)
    {
        string result = string.Empty;
    
        if (page.PageLink != null && page.PageLink.ID > 0)
        {
            var url = new UrlBuilder(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) +  HttpContext.Current.Request.ApplicationPath.TrimEnd('/') + page.LinkURL);
    
            if (UrlRewriteProvider.IsFurlEnabled)
            {
                Global.UrlRewriteProvider.ConvertToExternal(url, null, Encoding.UTF8);
                result = url.ToString();
            }
            else
            {
                result = url.ToString();
            }
        }
    
        return result;
    }

 

Now on my dev site this works well and produces the full URL that I need however on my production site this produces the URL in the internal format e.g. http://www.site.com/Templates/pages/page.aspx?id=1555&amp;epslanguage=en-GB

From the code I would guess that it's not getting into the condition IsFurlEnabled so is not converting it to an external URL. If this guess is correct then this leads me to the fact that Friendly URLs are not enabled in my production site but are in my dev site.

Based on this I've tried to determine how to enable this on production but as far as I can tell all the configuration is set up correctly and as I would expect compared to my dev environment.

Am I correct with this or am I missing something more obvious?

Thanks in advance,

Mark

#58318
Apr 19, 2012 10:26
Vote:
 

Does the url look friendly on your production site? Is the friendly URL rewriter the default URL rewriter provider in episerver.config?

#58320
Apr 19, 2012 11:32
Vote:
 

Hi Toni,

The URL of the page in the address bar on the production site is friendly e.g. www.site.com/AboutUs but the meta data item in the source of the same page is not.

The defaultProvider for the for the urlRewrite section in episerver.config is a custom provider but this is the same in both production and dev (it works in dev).

Mark

#58328
Apr 19, 2012 14:33
Vote:
 

Ok, then it shouldn't be your custom provider. But can you just for the sake of it switch it to friendly to see if it makes any difference?

#58330
Apr 19, 2012 14:43
Vote:
 

Using the EPiServerFriendlyUrlRewriteProvider makes no difference and it still displays the friendly address in the browser address bar and non friendly address in the source meta data...

#58331
Apr 19, 2012 15:07
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.