Fix OwnCloud .htaccess warning in IIS

Fix OwnCloud .htaccess warning in IIS

After much searching I’ve found a solution for the warning –
Security Warning
Your data directory and your files are probably accessible from the internet. The .htaccess file that ownCloud provides is not working. We strongly suggest that you configure your webserver in a way that the data directory is no longer accessible or you move the data directory outside the webserver document root.

The issue stems from OwnCloud’s not continuing support for windows server installs.  Linux uses .htaccess for settings and iis uses web.config.

Create a new configuratin file named web.config then paste the following code into the document and save in your data directory.  Delete all .htaccess files.

<?xml version="1.0" encoding="UTF-8"?>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
          <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />

Leave a Reply