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 ...
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={...
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 ...
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 ...
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>
...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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>
...
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....
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 ...
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-...
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(/.*)?$
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="...
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/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
redirect × 60sxa × 11
url-rewrite × 10
iis × 6
pipelines × 5
sitecore-client × 4
security × 3
links × 3
urls × 3
seo × 3
sitecore-forms × 2
mvc × 2
module × 2
settings × 2
nextjs × 2
jss × 1
sitecore-api × 1
content-editor × 1
configuration × 1
experience-analytics × 1
upgrade × 1
multilingual × 1
identity-server × 1
best-practices × 1
content-management × 1