« Previous Next »

Thread: Not serve certian folders/files

Last post 07-15-2009 5:20 PM by Geo_M_Fr. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 07-15-2009, 4:41 PM

    • Geo_M_Fr
    • Not Ranked
    • Joined on 07-15-2009, 4:36 PM
    • McHenry IL
    • Posts 2

    Not serve certian folders/files

    Hello,

    I am deploying websites to a server with svn, and would like to know how on IIS 7 to set it to never serve any files within the .svn folders in the website directory.  This is very easy to do in other web servers, so I am sure that IIS has some easy setting to do the same but I just cannot find it.

    Thank You for any help you may give.

    George Franz
  • 07-15-2009, 5:17 PM In reply to

    Re: Not serve certian folders/files

    You can use Request Filtering for that:

    http://learn.iis.net/page.aspx/143/how-to-use-request-filtering/

    I'm not familiar with svn, but if the name of the folders is literally ".svn" you can just drop a Web.config file in the site with the following contents:

    <configuration>
      <system.webServer>
            <security>
                <requestFiltering>
                    <hiddenSegments>
                        <add segment=".svn" />
                    </hiddenSegments>
                </requestFiltering>
            </security>
      </system.webServer>
    </configuration>

    If you want you can optionally install the User Interface for managing Request Filtering rules at: http://www.iis.net/extensions/AdminPack

  • 07-15-2009, 5:20 PM In reply to

    • Geo_M_Fr
    • Not Ranked
    • Joined on 07-15-2009, 4:36 PM
    • McHenry IL
    • Posts 2

    Re: Not serve certian folders/files

    Hey thanks a great deal, I thought it was something that could be added to web.config. I couldn't remember the proper way to do it. Saved me some research.

     George

    George Franz
Page 1 of 1 (3 items)
Microsoft Communities