Questions tagged [routing]
For questions related to the creation of custom or use of default routes in Sitecore, covering routing for MVC and WebAPI, in addition to ReactJS routing, etc.
28 questions
4
votes
1
answer
29
views
What options are available to handle the dynamic routes in Sitecore and Next.js?
What options are available to handle the dynamic pages in Sitecore and Next.js? Let's say we have created a page called "devpage" and we have the dynamic routes like this devpage/{dynamic ...
0
votes
2
answers
86
views
Custom MVC Routing in Sitecore does not read Sitecore context language
I am trying to create custom routing for multiple languages. Created processor like below image. Problem is that it does not give exact context language but gives "en" as language name. Can ...
1
vote
2
answers
93
views
HTTP 500 errors when accessing custom route which can't find a controller
Every time somebody tries to access a route "below" our custom API routes, we see an HTTP 500 error. Such errors are quite messy in our log, and we would like to convert it into 404 errors ...
0
votes
0
answers
184
views
Base URL is not coming correctly in AJAX call on landing page of sub site
My current Sitecore project has a multisite with URL structure as follows
www.MainSite.com
www.MainSite.com/SubSite
Whenever I do an AJAX call from the subsite landing page the base URL is coming as ...
0
votes
1
answer
44
views
{virtualFolder} in route config is not taking full path defined on the site defnition file
My current Sitecore(9.0.2) project have multisite implementation with URL structure as follows
Url: www.MainSite.com virtual folder:/
Url: www.MainSite.com/SubSite virtual folder:/SubSite
Url: www....
1
vote
1
answer
2k
views
Sitecore custom api routing is not working
We have a multi-site environment.
In one of the module, we are calling the same controller/action from all the sites. Perhaps, the same Javascript file which calls this controller/action is ...
0
votes
2
answers
2k
views
Redirect URL A to URL B
I want to redirect one URL to the another. Suppose, I have 2 URLs
www.abc.com/home/gateway [Item for /gateway is not created in sitecore]
www.xyz.com/newgateway.php [This is not a Sitecore Webpage]
...
1
vote
2
answers
3k
views
Troubleshooting Sitecore Identity Server routing errors in Sitecore 9
I am upgrading Sitecore 8.1 to 9.1. After resolving a number of config and dll-related errors, if I try to reach /sitecore I get redirected to
/identity/login/shell/SitecoreIdentityServer
Which ...
1
vote
1
answer
498
views
JSS LayoutService decoupled from Routing in Angular
Is it possible to decouple the use of the LayoutService from all of the Routing code and use it independently? We are upgrading an AngularJS application to Angular and have incorporated JSS but are ...
2
votes
1
answer
825
views
Requested document not found when using MVC routes
I am getting 404s (requested document not found) when I try to use a custom route I created per the guide here: https://kb.sitecore.net/articles/700677. My patch config is showing up in showconfig, ...
1
vote
1
answer
6k
views
Sitecore WebApi custom route not working controller not found
Controller:
public class ExampleController : Controller
{
private readonly ISitecoreContext _sitecoreContext;
public ExampleController ()
{
}
[System.Web.Http....
7
votes
2
answers
5k
views
A route named x is already in the route collection. Route names must be unique
EXM is throwing error when I go to the dashboard.
I see the following error in the Sitecore log file.
Exception System.ArgumentException: A route named 'CountriesV1' is
already in the route ...
4
votes
1
answer
996
views
Sitecore MVC Routing and Virtual Folders
I have a multi-site Sitecore instance with several sites defined using the physicalFolder/virtualFolder attributes defined on the <site> nodes all done with MVC. There is some functionality I ...
4
votes
3
answers
3k
views
ServiceApiController Method not found when using HttpPost and ComplexType (Sitecore 8.1.3)
I am working on refactoring some code and want to create WebApi services to do so. I have created an initialization pipeline that registers custom routes. I am still able to follow base sitecore ssc ...
3
votes
1
answer
1k
views
How to have a custom url for a listing page
I am unable to figure out the correct route configuration for this scenario.
The tree structure is as:
Home
|_Articles
|_Topic1
|_Blogs
|_blog1
|_blog2
|_Topic2
Each topic ...
1
vote
2
answers
701
views
I need to integrate a controller from a compiled dll into a controller I can build/control. How can I call that as a rendering?
I'm able to call this compiled dll's controller directly in a Sitecore rendering - e.g. I can create a rendering where I reference the controller, controller action, and area and the content from the ...
5
votes
2
answers
350
views
EntityService-based controllers stop working when adding a controller with a named route
ASP.NET Web API 2 allows to set route name on a controller:
Route names are useful for generating links, so that you can include a link in an HTTP response.
I define two controllers, each of them ...
3
votes
2
answers
831
views
Redirect requests based on missing data on wildcard item
I have a URL, myWebsite.com/locations, and currently if you go to myWebsite.com/locations/{any valid ID} you get a page with content about the location.
However, if you go to myWebsite.com/locations/...
4
votes
2
answers
875
views
How do I remove /sitecore from API calls?
A client I'm working with has an internal API built that they use for search purposes, now API URLs are being built like this:
website/internal-api/sitecore/controller/method
My Question is if there ...
3
votes
1
answer
62
views
wo url serving default.aspx
i've setup various rewrite rules within sitecore using the url rewrite module.
for some really bizarre reason /wo refuses to work, and browsing to /wo on other Sitecore sites I've worked on appears to ...
5
votes
1
answer
1k
views
How to pass dynamic parameters to a Sitecore page via the URI?
On our website we have a page which is accessible via a path like:
www.example.com/statistics
We would like this page to show different content based on the URI, e.g.
www.example.com/statistics/...
4
votes
1
answer
417
views
Html.Sitecore().Controller on a CD - No route in the route table matches the supplied values
I am having a similar problem to InvalidOperationException: No route in the route table matches the supplied values
That is, I am getting the error:
No route in the route table matches the ...
0
votes
1
answer
488
views
MVC Routing with Language Variant in Sitecore
I have MVC Routing issue in Sitecore. I have the following route in myRegisterRoutes() method. For this method I need to add language variant since I have enabled language fallback. Could some please ...
4
votes
0
answers
927
views
How to ignore routes from specific dlls in Sitecore 8.2 [closed]
Sitecore 8.2 update 1.
I have added few dll refences in project. The DLLs are from external application and have their own webapi controllers and routes.
I am using Autofac and excluding the ...
11
votes
1
answer
7k
views
InvalidOperationException: No route in the route table matches the supplied values
I've recently deployed a SC 8.1 update 3 site to production (seperate CM and CD) and on the CD side I'm getting this error:
Server Error in '/' Application.
No route in the route table matches the ...
3
votes
0
answers
562
views
Custom route for MVC controller in a market place package is not working
I am working on a marketplace package that services some analytics data via MVC controllers. But when testing I am finding several implementations of DI that cause my route to fail on the site.
One ...
7
votes
2
answers
2k
views
Error when using custom routes with https: "Attempt to retrieve context object of type 'Sitecore.Mvc.Presentation.RenderingContext' from empty stack."
We have a login/register modal that is being called via javascript on the front end. I created a custom route to point to the right action controller, and it works fine in every environment - except ...
5
votes
4
answers
6k
views
Passing a parameter to controller rendering through URL
I have a component on my page that is a controller rendering and I'd like to pass a parameter in through the URL, but not as a query string parameter. So, instead of site.com/product?id=123, I want: ...