Say I have 3 versions of a website: A, B and C. I want my urls to be of the form:
{siteType}/{controller}/{action}/{id}
where siteType
equals a
, b
or c
.
When the user is in the A version of the website, then they should stay there; therefore all generated urls should have a siteType of a
. Similarly for B and C.
I don't want to have to explicitly specify the siteType
when generating urls - I want it generated automatically. Furthermore, the siteType
parameter will only ever be used in one place - the overrided RenderView
method in a base controller class - which will use the siteType parameter to pick out the correct view, css etc for that version of the website. I therefore have no interest in the siteType
appearing as an argument to my actions. Only the RenderView
method requires access to it.
What is the best way to achieve this?