Run ASP.NET MVC website in sub directory (map route values)

Discussion in 'Site Programming, Development and Design' started by Steven McLintock, Jan 21, 2015.

  1. Hi there,

    I'm running a few websites under my Winhost account in different sub-directories, and use the Web.Config file to redirect different domain names to the sub-directories.

    <rule name="Site" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^(pines\.)?stevenmclintock\.com$" />
    <add input="{PATH_INFO}" pattern="^/PinesVilla($|/)" negate="true" />
    </conditions>
    <action type="Rewrite" url="\PinesVilla\{R:0}" />
    </rule>

    Unfortunately, there is a problem with one of the websites (ASP.NET MVC) when submitting a form to a controller. E.g. http://pines.stevenmclintock.com/Login. What should be happening is the user should be logged in, or the model returns a validation error (e.g. http://www.pinesvilla.com).

    What I can see so far is the POST request is returning a 301 redirect and then a GET request. The advice I've had so far is to change my route values, but I'm not sure what to try?

    Would anyone know how to solve this?

    Thanks,
    Steven.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page