locked
Web.config : location path : contains some parameter like : myfile.aspx?items=first RRS feed

  • Question

  • User810415940 posted

    Hi,
    In my web.config (On IIS with .NET Framework 4.0)

    I use :

        <location path="myfile.aspx">
          <system.webServer>
            <httpRedirect enabled="true" destination="http://www.website.com/item.htm" httpResponseStatus="Permanent" />
          </system.webServer>
        </location>

    and it works without error. It's nice.Laughing

    But my old url contains some parameter like : myfile.aspx?items=first

    So I change my code like this :

        <location path="myfile.aspx?items=first">
          <system.webServer>
            <httpRedirect enabled="true" destination="http://www.website.com/1st_item.htm" httpResponseStatus="Permanent" />
          </system.webServer>
        </location>

    And I have the following error:Frown

     <location> path attribute must be a relative virtual path. It cannot contain any of '?' ':' '\' '*' '"' '<' '>' ou '|'.

    How can I fix it ? Could you help me please

    Wednesday, July 27, 2016 8:47 PM

All replies