Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
14 votes
Accepted

How to prevent Sitecore resolving the Language based on the URL

If you don't want FilePath based language resolving, simple do below setting in Sitecore.config: <setting name="Languages.AlwaysStripLanguage" value="false" /> This will do nothing but ...
Yogesh Patel's user avatar
  • 1,007
14 votes
Accepted

Why does my marketing URL redirect me to the site root?

Props to @rosscartwright, @cassidydotdk, and @jammykam for getting us to the answer at lightning speed and for the helpful links. The issue was a feature of Sitecore called AlwaysStripLanguage that ...
Richard Hauer's user avatar
7 votes
Accepted

Does Sitecore support internationalization with Urls?

For your request you can use Display name functionality Display names can include characters not allowed in item names. Display names can vary by language, where item names cannot. Because display ...
Vlad Iobagiu's user avatar
  • 18.6k
5 votes

Redirecting to Lowercase URL and removing trailing slashes for SEO

Have you checked the configuration in LinkManager? <linkManager defaultProvider="sitecore"> <providers> <clear /> <add name="sitecore" type="Sitecore.Links.LinkProvider,...
Sumit Upadhyay's user avatar
5 votes
Accepted

MediaManager throwing null error

From what I can tell your exception says in fact that you passed null MediaItem to GetMediaUrl method. It looks like you have a field ImageField imageItem but imageItem.MediaItem is null. It's either ...
Marek Musielak's user avatar
  • 23.8k
5 votes
Accepted

mutated vowel in display name and don't show it in the generated url

In general, when using the out of the box functionality and fields , you can specify the display name to any value you like for the URL. It appears you have already configured your Link Provider to ...
Jason St-Cyr's user avatar
  • 6,791
5 votes
Accepted

Why does MediaManager.GetMediaUrl() return internal "/sitecore/shell/-/media" URL instead of "~/media" URL?

From what I remember, if you add an image from media library into RTE field, Sitecore uses the following format: <img src="-/media/5EA5C007FFFF4688A0B7E6F58B79D2E8.ashx" /> With your media ...
Marek Musielak's user avatar
  • 23.8k
5 votes
Accepted

Unwanted Sitecore URL

You need to block them. Ideally, Google should never have been told about these URLs in the first place, it looks like you might have some mismanaged Site Url Generation going on elsewhere. But for ...
Mark Cassidy's user avatar
  • 25.3k
4 votes
Accepted

When should I use ScalableLinkProvider or ItemSearchLinkProvider?

ItemSearchLinkProvider ItemSearchLinkProvider is a very simple provider with GetItemUrl method which: Checks if item is inside a bucket If no it returns base.GetUrl - where base class is Sitecore....
Marek Musielak's user avatar
  • 23.8k
4 votes
Accepted

Sitecore Url not working - layout not found error

This may happen when you have a sibling item (e.g. folder or item without a layout) with the same name or display name. Be aware that Sitecore replaces hyphens to spaces when it tries to find an item ...
Marek Musielak's user avatar
  • 23.8k
4 votes
Accepted

How do I allow only the configured language for each site?

I don't know of an ootb solution, this is how I usually "fix" this issue: Add a setting to the site definition that lists all available languages Add a a processor to the httpRequestBegin pipeline ...
Gatogordo's user avatar
  • 20.1k
4 votes
Accepted

Why is Display Name and the Item Name in the URL resolving to the same item

This is how Sitecore works with item resolving. It will resolve via Item Name or Display Name. Setting the useDisplayNames in the LinkProvider will have zero effect on how Sitecore resolves the item ...
Richard Seal's user avatar
  • 20.5k
4 votes

Getting an item using Powershell having only the URL

You can get item by URL using below function. You may have to tweak it for resolving wildcard items. function GetItemByUrl($url){ $url = [System.Uri]::new($url); $siteContext = [Sitecore....
Surya Narayan's user avatar
4 votes

How to get URLS added in the Rich Text field and Link Manager Fields?

From what I understand, you want to implement custom logic for generation of internal links added by content authors in Rich Text fields. If that's the case, you need to change the logic of ...
Marek Musielak's user avatar
  • 23.8k
3 votes
Accepted

Custom Item Url Builder

The update in Sitecore 9.3 adds the new itemUrlBuilder configuration to control how item and media URLs are built. Unfortunately, this in not wired into the IoC container (unlike the LinkManager ...
jammykam's user avatar
  • 13.8k
3 votes
Accepted

Is it possible to teach the keepalive agent to overcome TLS/SSL certificate warnings?

You can override UrlAgent that is used to make keepalive.aspx call. And disable certificate validation: System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, ...
Anton's user avatar
  • 3,821
3 votes

Why does MediaManager.GetMediaUrl() return internal "/sitecore/shell/-/media" URL instead of "~/media" URL?

This happens because your context site is "shell" . You need to switch to website site using : using (new SecurityDisabler()) { var item = mediaCreator.CreateFromStream(ms, fileName, ...
Vlad Iobagiu's user avatar
  • 18.6k
3 votes
Accepted

Sitecore 9.3 CustomLinkProvider

The problem you are trying to solve, rendering the full URL with host name, does not require a custom link provider since this behaviour is available out of the box. There are 2 settings which control ...
jammykam's user avatar
  • 13.8k
2 votes

Alias with query string

You won't be able to do this with an ootb alias and customizing that code just for a querystring seems a bit overkill. Why not use redirects? There is a redirect module on the marketplace (https://...
Gatogordo's user avatar
  • 20.1k
2 votes

How to make query to form as part of base URL

You could use Sitecore wildcard item(s) to achieve this. You create a page underneath searchpage and name it "*". Sitecore will map all request that are made to something underneath searchpage (and ...
Gatogordo's user avatar
  • 20.1k
2 votes

Message: A potentially dangerous Request.Path value was detected from the client (>)

ASP.NET implements various algorithms for securing ASP.NET websites against potentially malicious user requests, for example, by rejecting requests that contain characters susceptible to be used in ...
Mahendra Shekhawat's user avatar
2 votes
Accepted

Can I include image URL options with Synthesis field rendering helpers?

Synthesis has an extension method for ImageFields called RenderDpiAware (link) that allows you to specify a bunch of sizes to be used in a CSS source set. Additionally, the Render() extension method (...
Ben Lipson's user avatar
  • 1,382
2 votes
Accepted

How to reload the current page with a query string parameter

If you only want to refresh the querystring and nothing else, you don't have to write the url for the current page, you can just write the querystring part: click <a href="?test">here</a> ...
morten.engel's user avatar
2 votes
Accepted

Should targetHostName and hostName be the same?

targetHostName attribute is used to generate URLs from linkManager when SiteResolving is set to true. The host name to use when generating URLs to items within this site from the context of ...
scFootsteps's user avatar
  • 3,851
2 votes
Accepted

Sitecore how to get an ImageField full url, not a relative path?

you have to use MediaUrlOptions and to pass it to GetMediaUrl method. You will have: var image = new MediaItem(imageField.MediaItem); MediaUrlOptions mediaUrlOptions = new ...
Vlad Iobagiu's user avatar
  • 18.6k
2 votes

Sitemap generating random urls

bgsi/public/group_scheme/index.jsp Sounds like Java Server Pages. Sitecore is based on .Net and doesn't use this page extension. That is why I assume that it could be added by some external sitemap(...
Anton's user avatar
  • 3,821
1 vote

Sitemap generating random urls

If you take a look at the current implementation of the SitemapGenerator service in Sitecore.XA.Feature.SiteMetadata.dll, there is a method GetFullUrl which renders the url in the sitemap ...
Cristi Vulturar's user avatar
1 vote
Accepted

Image hash in URL causes image to have black background in normal mode

It turned out to be that there were two images with the same path / name. One was a jpg and one was a png. Because we're using paths instead of IDs for the image URLs, Sitecore seems to have trouble ...
Marcel Gruber's user avatar
1 vote
Accepted

Getting 404 error on a page when url is using item name

There can be several reasons why you are seeing this weird behavior. Some of them are listed below: Is it happening for all the pages? If yes, you need to check the sitedefinition.config Does the ...
Sumit Upadhyay's user avatar
1 vote

mutated vowel in display name and don't show it in the generated url

I would suggest to use the encodeNameReplacements in the web.config This is the default set: <encodeNameReplacements> <replace mode="on" find="&amp;" replaceWith=",-a-," /> <...
Tamas Varga Sitecore's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible