6

I'm new to MVC and trying to achieve page redirection. User will click on "Sign-out" and should be redirected to the "sign-in" page.
Here is my code.

public ActionResult SignIn()
{
  if (Sitecore.Context.IsLoggedIn)
  {
    LogoutUser();
    return RedirectToRoute(MvcSettings.SitecoreRouteName, new { pathInfo = "/en/sign-in" });
  }
}

This method is invoked, but the page is redirected to "en/?f" and the message on page is

This domain is not configured for this service. Please add it to your account.

Should something be configured for routes or in web.config.

Using Sitecore 8.0 update 5

enter image description here

11

To do page redirection, simply do

return Redirect(url);

For a permanent redirect (e.g. for search engines), use

return RedirectPermanent(url);

Both of these return a RedirectResult which inherit from ActionResult.

To redirect to a Sitecore Item, do it the same way you always have.

var url = LinkManager.GetItemUrl(yourItem);
return Redirect(url);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.