Password protecting a directory outside of wordpress.

Discussion in 'Site Programming, Development and Design' started by canann, Nov 29, 2013.

  1. I have a site that used Wordpress, and I have a directory outside of wordpress that I wish to use - but I wish to password protect this folder, Can anyone advise me as to how I do this - so that it will not interfere with the Wordpress site.

    This folder contains only a xml file that I wish to read/write and access thru a .exe file on the local system.
    What would be the format of the connection.

    Many thanks in advance - hope someone can help.
  2. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015
  3. I do not have access to IIS 7 i am using windows 8
  4. Elshadriel

    Elshadriel Winhost Staff

    Follow the instructions in this link to enable it.
  5. Ok - thanks I got that far - now can you direct me to a similar tutorial on how to protect the directory.

    Apologies - I am new to this .... and thanks
  6. ComputerMan

    ComputerMan Winhost Staff

    Once you have connected to your site via IIS Manager.

    • Navigate to the directory you want to password protect in the left pane
    • Double click Authorization Rules icon in the main window
    • Click Add Deny Rule
    • In the pop up dialogue box, select All anonymous users
    • Click OK
    • Note that this action will add some entries into your web.config file
  7. Thank you so much all of you - that was a great help.
  8. Hi, I have the same question and tried the referenced KB arcticle. Unfortunately it doesn't work for me. I get this error message:

    Config Error The configuration section 'security' cannot be read because it is missing a section declaration

    If I use a simple deny rule, I can still access other files in my folder directly. What I want is that regardless of what file, I want a login page first to protect access to and files in that folder.
    Do you have an example I can use?
  9. This is the web.config I have in the folder:

    <?xml version="1.0" encoding="UTF-8"?>
    <authentication mode="Forms">
    <forms loginUrl="logon.aspx" protection="All" path="/" name=".ASPXFORMSAUTH">
    <deny users="?" />

    It gets me the logon page when accessing the folder, but allows access to each file inside the folder.
  10. Elshadriel

    Elshadriel Winhost Staff

Share This Page