简体   繁体   中英

Simulate a redirect to an action in umbraco v 4.7.2

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM