I am trying to shorten url of a site that my company develop using sitecore. I have been looking into Alex Shyba's blog post here and Sitecore documentation here, but it seems doesn't work. What I want to shorten is from localhost:8081/sitecore/Content/Sites/HeinzABCID/Dapur.aspx
to localhost:8081/Dapur.aspx
That url is generated by LinkManager.GetItemUrl()
method. My code is like below to get the option and the link.
UrlOptions opt = (UrlOptions)UrlOptions.DefaultOptions.Clone();
opt.SiteResolving = Sitecore.Configuration.Settings.Rendering.SiteResolving;
linkToResep.NavigateUrl = LinkManager.GetItemUrl(citem, opt);
While in my web.config
I have put the configuration like below.
<linkManager defaultProvider="sitecore">
<providers>
<clear/>
<add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel"
addAspxExtension="true"
alwaysIncludeServerUrl="false"
encodeNames="true"
languageEmbedding="asNeeded"
languageLocation="filePath"
shortenUrls="true"
useDisplayName="true"/>
</providers>
</linkManager>
The configuration/sitecore/sites/site
with name="website"
part in my web.config is below.
<site name="website" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/Content/Sites/HeinzABCID" startItem="/Home" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" language="en" disableClientData="false"/>
I don't have any other site, just that with default(shell, login, admin, service, modules_shell, and modules_website).
And here is the site structure of my site.
/sitecore/content/sites
+Sites
+---+HeinzABCID
+---+Dapur
+Search
+Other Items
Please help me :)
web.config
. Sorry for I forgot to add that before. – didityedi Jan 16 '13 at 3:22Item
on my question. Thank you. – didityedi Jan 16 '13 at 13:55