5

I have a website I am developing (http://www.mywebsite.com/) that makes use of subdomains. Basically what I want is when you go to: http://www.mywebsite.com/Redirect, it redirects you to http://blahblah.mywebsite.com/SpecificController/SpecificAction.

I know about Redirect, but that doesn't let you send POST parameters (as far as I know), and RedirectToAction doesn't let you specify a subdomain.

Entity
  • 7,972
  • 21
  • 79
  • 122
  • Take a look at [this question][1] [1]: http://stackoverflow.com/questions/278668/is-it-possible-to-make-an-asp-net-mvc-route-based-on-a-subdomain – Dmitry Efimenko Jan 11 '12 at 19:49

1 Answers1

1

For subdomains in routes check this guide to domain routing

When you have it set up. for a specific redirection you can use this:

return RedirectToAction("SpecificAction", 
        "SpecificController",
         new { subdomain = "blahblah");

As for the post part, you can just use the TempData dictionary (TempData["varName"]) to pass the data to the next controller/action

Mihalis Bagos
  • 2,500
  • 1
  • 22
  • 32