Skip to main content
23 votes
Accepted

URL Redirects, When to use Sitecore vs. when to use IIS UrlRewrite Rules

Using IIS URL Rewrite (or firewall/load balancer/CDN) is appropriate for all domain-name and protocol changes (i.e. everything to the left of "/"). This covers #1, #2, and #3 from your list. I'd ...
Ed Schwehm's user avatar
  • 3,036
10 votes
Accepted

How to deep link into Experience Editor so that user is redirected after login?

Instead of linking to an item with an id parameter, instead link to the full item URL with sc_mode=edit parameter set, e.g. {cmsHost}/path/to/item-page?sc_lang={itemLanguage}&sc_version={...
jammykam's user avatar
  • 13.9k
9 votes

URL Redirects, When to use Sitecore vs. when to use IIS UrlRewrite Rules

If it was my decision I would insist that everything that is configured once and you don't plan to change it (like 1, 2 and 3 from your list) always should be set before they even hit Sitecore. IIS ...
Marek Musielak's user avatar
  • 24.1k
9 votes

Sitecore 301 Redirect or IIS URL Rewrite

Well in any case you will have to bind example.com as well as www.example.com on your website. Next you have multiple options. Either use IIS Rewrite rules. <rule name="Root Hit Force HTTPS ...
Bart Verdonck's user avatar
9 votes

How to setup a Reverse proxy with Sitecore?

We faced the same issue about a month ago. You can use the following rewrite rule. <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> ...
Tamás Tárnok's user avatar
7 votes
Accepted

Sitecore 301 Redirect or IIS URL Rewrite

Yes, You can achieve this requirement through Sitecore 301 Redirect Module or IIS URL Rewrite both. Paste the below Code inside your <system.webServer></system.webServer> element in the ...
Ashish Bansal's user avatar
6 votes

Redirecting to another item in an AJAX request

The problem here is that 301/302 redirects are handled by the browser (or more specifically, by the XMLHttpRequest object) transparently. This means that your success handler will be called only when ...
Dmytro Shevchenko's user avatar
5 votes

Implementing redirect url feature in the ItemResolver pipeline

Problem is with: if (Sitecore.Context.Item == null) in your code. After ItemResolver is executed, that will be never null for Sitecore items. That's why you only see this hit for ...
Marek Musielak's user avatar
  • 24.1k
5 votes

How to set a default page for a folder?

Quick and clean solution: Create a new template (called "Folder with default item" or whatever you prefer), inheriting from the standard Folder template Add a field to your custom folder (e.g. ...
Marek Musielak's user avatar
  • 24.1k
5 votes
Accepted

Can SXA redirect map entries redirect from a Sitecore URL to an external one?

No, Redirect Map can only redirect to other items on a current site (it will try to append to a URL string that you define in the mapping). Redirect Map + Redirect Item Although it is not a perfect ...
Alan Płócieniak's user avatar
5 votes
Accepted

301RedirectModule isn't working for URL with dot file name

The issue is the request is not being processed by Sitecore, since it is seeing .oldRegistration as file extension and it has not been configured as an allowed extension. You need to add all the ...
jammykam's user avatar
  • 13.9k
5 votes

301RedirectModule isn't working for URL with dot file name

This is generally caused by IIS configuration. By default IIS assumes that any file extension not already registered (.aspx, .ashx etc.) is a static file. It will try and locate that file and as its ...
Svenkle's user avatar
  • 207
5 votes
Accepted

301 Redirects for Non SXA site in a Sitecore SXA instance

The redirect behavior in SXA only applies to sites managed by SXA. Consider the options typical of a non-SXA implementation but be aware of the risks and limitations of each. Examples Redirect in ...
Michael West's user avatar
  • 18.5k
4 votes
Accepted

IIS redirect for legacy URLs - Sitecore interference

The matching is done on the path after /, so your rule should not start with that. Try using just ^(.*)/Pages/(.*).aspx instead, or ^Old/(.*)/Pages/(.*).aspx if you need the Old part there as well. ...
Søren Kruse's user avatar
  • 3,255
4 votes

URL Redirects, When to use Sitecore vs. when to use IIS UrlRewrite Rules

As developers, we sometimes too focused on our application and forget about other cool tools we have around us. In your question you are referring to two options - IIS and Sitecore, but there is at ...
Dmitry Harnitski's user avatar
4 votes

Sitecore Redirect Module created redirects when an item has moved above/below a sibling but still has same path

This appears to be an issue with the Redirect Module itself but I fixed it by cloning the module repo and modifying the OnItemMoved method in AutoCreateRedirectOnMove.cs: public class ...
Erica Stockwell-Alpert's user avatar
4 votes

URLRedirection Custom HttpRequestProcessor

In your configuration, you are overwriting (patch:instead) the Sitecore processor (ItemResolver) responsible for figuring out the context item based on the HTTP request. If you remove that, not much ...
maz's user avatar
  • 1,823
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
  • 24.1k
4 votes
Accepted

How to implement a Reverse Proxy in Sitecore?

IIS Rewrite cannot do that by itself, you will have to install the Application Request Routing (ARR) IIS Extension for that, you can download it here. When you have that installed you can put in ...
Jeroen's user avatar
  • 1,224
3 votes

How to include querystring in Redirects

This is not allowed due to usage of the Name Value List field type in that Mappings field which only allows keys containing letters and numbers due to the Validate() method in it. See further details ...
Peter Procházka's user avatar
3 votes

Sitecore analytics is not working after doing changes in IIS Url Rewrite Module

Based on the error above, it looks like you are rewriting too many URL formats. Your client likely wanted folders (like "www.example.com/about-us") rewritten to have trailing slashes, not all file ...
Jason St-Cyr's user avatar
  • 6,791
3 votes
Accepted

Implement subdomain redirects while using sitecore URL Rewrite module

The Sitecore URL rewrite module is conceptually based on the IIS Rewrite Module Shiva referenced. You would essentially do the same thing Shiva outlined but withing Sitecore using the Inbound Rule ...
Chirag Patel's user avatar
3 votes
Accepted

Why does Sitecore redirect with status code 302 for page not found errors?

I'm not sure it's necessarily a case of that they won't fix it, it's just a case of priority. Like all development projects, they'll have a backlog of issues and features that they want to address, ...
Kasaku's user avatar
  • 4,184
3 votes

HTTPS to HTTPS 301 redirect for whole domain?

This IIS Rule should work for both HTTP and HTTPS <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> ...
Surya Narayan's user avatar
2 votes
Accepted

WebUtil.Redirect - Cannot redirect after HTTP headers have been sent

This exception can happen in at least 2 cases: There is already a redirect that has been initiated earlier during the page request. Your application wrote other headers to the response before WebUtil....
Dmytro Shevchenko's user avatar
2 votes

How to set a default page for a folder?

You could add a General Link field on the Folder template to allow the content editor to select which page it should redirect to by default. You would also need to create a Controller Rendering to ...
Adhir Ramjiawan's user avatar
2 votes

How to allow editors to configure redirection for a particular Item/Page?

You can use redirect module : https://marketplace.sitecore.net/Modules/301_Redirect_module.aspx?sc_lang=en Github repository where you can get the code and to modify it: https://github.com/Chris-...
Vlad Iobagiu's user avatar
  • 18.7k
2 votes
Accepted

Redirect Maps for wildcards not working

I believe there is some logic in SXA to ensure that the text is actually a regular expression. It should start with ^ and end with $. Try this format: ^/careers/job-opportunities(/.*)?$
Michael West's user avatar
  • 18.5k
2 votes
Accepted

HTTPS to HTTPS 301 redirect for whole domain?

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="...
Chris Auer's user avatar
  • 13.2k
2 votes

XMCloud Vercel app Redirect URL from uppercase to lowercase

We have achieved this by creating a custom middleware function. Create a file for your custom middleware, let's say smallcase-url, in your project's directory, such as src/<appname>/src/lib/...
Raman Gupta's user avatar
  • 2,649

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