title: Translating htaccess file to web_config / IIS
body: <p>I have been driven around the bend trying to figure this out and I'm at the point I don't know what I am doing wrong and also what I am actually doing.</p>
  <p>I have just moved from a Linux shared host running Plesk to a Dedi Windows server with Plesk installed on it. I have moved everything across files wise, DNS etc.</p>
  <p>However, when I visited the sites I realised that when I navigated to a page which isn't the index it will give me a 404 error page. After some investigating, I realised that Plesk Linux uses Apache a.k.a .htaccess files compared to Windows Plesk using IIS a.k.a web_config file. I know my issue is that my new server isn't handling the exclusion of file extensions in the url. However, the issue I am having is I tried converting my below .htaccess files using <a href="https://cbsa.com.br/tools/online-convert-htaccess-to-web-config.aspx" rel="nofollow noreferrer">this online converter</a> into a web_config file however I keep getting internal server errors. I then read <a href="https://www.saotn.org/convert-htaccess-web-config/" rel="nofollow noreferrer">this solution</a> which says you can import .htaccess code to use in the IIS manager however the IIS manager keeps giving errors or when it says everything is okay my websites still give the 404 error message.</p>
  <p>If anyone can point me in the right direction it would be super helpful!</p>
  <p>The two .htaccess files I use and trying to convert are as follows, also if they are messy blame my friend as he made them for me. One which denies looking at the directories, removing html, php file extensions and cache which can be seen below and the second is just a simple deny from all that I put into the directory where I am storing database connection details etc.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;IfModule mod_rewrite.c&gt;
  
  Options +FollowSymLinks
  Options -MultiViews
  RewriteEngine on
  
  ErrorDocument 404 /404.php
  
  # Remove www from any URLs that have them:
  RewriteEngine on
  
  
  
  # Three days for most static assets
  &lt;filesMatch ".(htaccess|css|jpg|jpeg|png|js|php|html)$"&gt;
      &lt;IfModule mod_headers.c&gt;
          Header set Cache-Control "max-age=604800, public, must-revalidate"
      &lt;/IfModule&gt;
  &lt;/filesMatch&gt;
  Options All -Indexes
  
  # deny access to evil robots site rippers offline browsers and other nasty scum
  RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]
  RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]
  RewriteCond %{HTTP_USER_AGENT} ^attach [OR]
  RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
  RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
  RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]
  RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
  RewriteCond %{HTTP_USER_AGENT} ^Zeus
  RewriteRule ^.* - [F,L]
  
  RewriteRule ^index\.php$ / [R=301,L]
  RewriteRule ^(.*)/index\.php$ /$1/ [R=301,L]
  
  RewriteRule ^index\.html$ / [R=301,L]
  RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME}.html -f
  RewriteRule !.*\.php$ %{REQUEST_FILENAME}.html [QSA,L]
  
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
  &lt;Files 403.shtml&gt;
  order allow,deny
  allow from all
  &lt;/Files&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Deny From All</code></pre>
  </div>
  </div>
  </p>