1

I have an umbraco v 4.7.2 and should perform an user activation. When a new user registers on the site, it recieves an e-mail with the activation link.

Say, the link is

http://www.example.com/activate?user=john&?activationCode=s0m3Act1vat1on_c0d3

in the umbraco BackOffice there is a page, located at some arbitrary position, say

siteRoot\aFolder\UserActivation

I have multiple sites in umbraco (say "Example1 EN", "Example1 FR", "Example2 EN"). Each site has its own activation page(that process the activation). To obtain the address to that page in code, I made a ContextPicker parameter (named ActivationPage) on the site's Home page.

How should I redirect the fixed path mysite.com/activate?+params to that ActivationPage in order to process the activation?

If I use URLRewrite, how can that module access to the individual site's settings?

PS. When I say simulate a redirect to an action, I relly mean it, because we have no really conrollers/actions mechanism (I am not sure even if umbraco 4 can support it)

serhio
  • 28,010
  • 62
  • 221
  • 374

1 Answers1

0

You don't need MVC to do this. You just need the ability to rewrite or redirect the request.

Therefore you can use the ~/config/UrlRewrite.config file to add a redirect or you if you are using IIS7+, you can use the UrlRewrite2 module and specify a redirect path in the web.config.

Edit:

Based on the new information, you would either need to include a parameter in the query string identifying the target site. This way you could easily use UrlRewrite.config or IIS's UrlRewrite2 module.

If you can't do this, then you will need to have a physical published page/or file at the address http://www.example.com/activate. This would then have to do the redirect for you via the masterpage's codebehind class.

Digbyswift
  • 10,310
  • 4
  • 38
  • 66
  • To obtain the redirect URL, the URLRewrite should acces the 'ActivationPage' parameter, that is specified for each concrete site. Usualy, the url rewrite takes a URL and gives an other, regardless to the concrete site specific params, is't it? Say, I have mysiteEN mysiteFR myothersiteES and each site has its own address to activate the user – serhio Aug 28 '14 at 09:23
  • You can easily pass the querystring parameters to the redirected URL. However, if your scenario is more complicated than a straightforward redirect then you should detail this clearly in your question. – Digbyswift Aug 28 '14 at 09:39
  • In the site root node I declared a generic parameter 'ActivationPage', that specifies the url where the activation should be processed. So when I recieve the example.com/activate?+params I should 1) recuperate the redirect url from the site root node and 2) redirect to the url. How does the "UrlRewrite" module identify the target site and its root node params? – serhio Aug 28 '14 at 11:02
  • a) every user always recieves the same (main)link to activation: `http://www.example.com/activate?u=name&c=code` b) the "example" site has param 'activationPage' == '/user/activation', so finally the site should redirect the requesto to `http://www.example.com//user/activation?u=name&c=code` – serhio Aug 28 '14 at 12:53
  • I'm not sure what the difficulty here is. You need one rule per site. All requests to http://mysiteEN.com/activate?u=name&c=code get redirected to http://mysiteEN.com/user/activation?u=name&c=code and then a rule for each of the other sites. All you have to do is ensure the name and code parameters are passed to the redirect which is easy in UrlRewrite.config (using regex) or UrlRewrite2. – Digbyswift Aug 28 '14 at 13:21