23

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 argue that Sitecore should be used for any redirect (other than the above redirects) that editors/authors are responsible for. Putting those redirects in Sitecore ...


10

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={itemVersion}&sc_mode=edit The user will be redirected to the login page with the correct returnUrl parameter and then correctly redirected back to the item in ...


9

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 Redirection" enabled="true" stopProcessing="true"> <match url="^$" ignoreCase="false" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /...


9

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 UrlRewrite module is one of the options. No points in wasting any IIS resources for them. They won't be changed by authors, editors, marketers or administrators ...


8

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> <rewrite> <rule name="Blog rewrite" enabled="true" > <match url="^blog/(.*)$" /> <action type="Rewrite" url="http://your.other....


7

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 web.config <rewrite> <rules> <rule name="Redirect Maps Rule" stopProcessing="true"> <match url=".*" /> <conditions&...


6

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 the browser issues a second request and loads the page it was redirected to. So you should not attempt to use redirect response codes in AJAX calls. Instead, I ...


5

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. Droptree, and set the Source of the field to query:./*) Add new httpRequestBegin processor after ItemResolver. Use code (not tested - try and fix if needed): public ...


5

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 VisitorIdentification. If you want your code to be executed when Sitecore "page" is loaded, change your code to if (Sitecore.Context.Item != null) { ... }


5

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 extensions that you want processed, since the module works integrates in the Sitecore pipelines: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"&...


5

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 not actually a file you'll get a 404. You will need to configure IIS to pass these kinds of requests through to your Sitecore instance. Once configured the URL ...


5

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 CDN/Proxy - difficult to apply for many 1-to-1. Cloudflare for example limits the number of available page rules. IIS Rewrite module - Low complexity for large ...


4

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. Also, you could probably improve the regex a bit by requiring at least one character in the two wildcard groups and by escaping the . before aspx: ^Old/(.+)/...


4

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 least one more. I am talking about network hardware that handles traffic between user and IIS. It is not uncommon to find 'smart' Load Balancer or Firewall that ...


4

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 solution you could redirect to an existing Redirect Item (Redirect a URL) and define external URL there. One important thing about Redirect Map. It will match ...


4

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 in the tree, so if your url is customer-care-support you have a sibling with a name customer care support next to your customer-care-support item, you can ...


4

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 AutoCreateRedirectOnMove { protected void OnItemMoved(object sender, EventArgs args) { //ensures arguments aren't null Assert.ArgumentNotNull(sender, "...


4

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 something like this: <rewrite> <rules> <rule name="Reverse Proxy" stopProcessing="true"> <match url="^home/legend$" /&...


3

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 is going to work. Since your logic applies only when no such context item has been found, your processor should run after (patch:after) the item resolver, like ...


3

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 names. File paths like .htm, .aspx, .css, etc. should not usually be rewritten in this way. It breaks the file extension.


3

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 with a Condition instead of the Simple Redirect way you are trying now. Steps: Create a new Inbound Rule item - call it whatever you want Pattern: (.*) Create ...


3

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, and how they go about prioritising them is up to them. I'm not sure of the original decision behind the 302 redirect, and I can't think of a good reason why it ...


3

This IIS Rule should work for both HTTP and HTTPS <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="SiteA to SiteB" stopProcessing="true"> <match url="(.*)" /> <conditions> ...


2

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.Redirect was called. In both cases, you should get a clue about what's happening by setting a breakpoint on the line with WebUtil.Redirect and looking at the ...


2

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-Castle/301RedirectModule On the redirect module you have the option to create rules for redirecting your requests to other landing pages.


2

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 here: Why Sitecore does not allow to use special characters in Name Value List field as a key? In your case also second option on how to find match and that ...


2

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="newmexicomastersswimming"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="^www\....


1

As an alternative you can write your own processor. For example like you would create a 404 processor, but then let it hook into a Sitecore list where you map url's to external links. Like: public class NotFoundRedirectProcessor: HttpRequestProcessor { public override void Process(HttpRequestArgs args) { if (Sitecore.Context.Item != null || ...


1

Try the following rule: <rule name="Default Language" patternSyntax="ExactMatch" stopProcessing="true"> <match url="en" /> <action type="Redirect" url="/en-us" /> </rule> You don't need wildcard or regexes for matching exact url - just use ExactMatch pattern syntax - it will be microseconds faster, but remember that it's ...


1

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(/.*)?$


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