I'm not a 100% on this but I recall always failing when the first part is something dynamic.
Try putting "b/" first in the pattern and you will probably see it working.
Thanks for replying Johan,
Sadly enough this did not do the trick, are there any other possibilities?
Greetings,
Abdellatif
Maybe try a catch-all and then split the value in controller?
routes.MapRoute("sample", "b/{*path}", new {controller = "Sample", action = "Index"})
And then have something like Index(string path)
Try creating a page and a page controller but no view. That way you use Optimizely's built in MapContentRoute to worry about the language segment for you.
In terms of making the id part of the friendly url, use a Partial Router: https://www.hiddenfoundry.com/thoughts/changing-query-string-parameter-to-a-friendly-segment-in-optimizely/
@Surjit Bharath,
Sadly all of model information is not available in Epi, all of the information comes from our external API.
We need to use our controller just for managing this page, because of that we could not use the IPartialRouter.
Are there other ways to do this without using 'Epi Data structure (IContent)'?
Sincerely,
Abdellatif
I'm assuming your Controller is then just a standard mvc controller? and since you don't want it relying on IContent then your url should be fixed?
In which case you see Johan's comment about the catch all routing then registering last.
Yes, we want to create a standard MVC controller with standard route path and create a page with this controller, without Epi integration.
We already tried Johans proposal, and that did not work for us.
Hello There,
As a developer I want to create a custom routing for my controller. This controller is created outside of the EPi CMS.
ex. "https://test.com/en-us/b/custom-url-5"
routes.MapRoute("sample", "{language}/b/{friendlyUrl}-{id}", new {controller = "Sample", action = "Index"})
Is there something wrong with the routing setup? or am I missing another configuration?
Sincerely,
Abdellatif