-1

My client is using an IIS webhosting service that (annoyingly) doesn't recognize index.php as a default document. I've written a simple index.html that <meta> refreshes the page to index.php, but is there a way to do what I'd normally do in a .htaccess document in IIS?

For example, can I write a web.config document that does the following and drop it in root, like I would a .htaccess?

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^$
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^$ http://www.example.com/index.php [L,R=301]

I don't have any other access than FTP.

halfer
  • 19,824
  • 17
  • 99
  • 186
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
  • 1
    I seem to recall IIS used to use `Default.asp`, so might it be configured with similar for PHP - `Default.php` maybe? – halfer May 13 '15 at 23:51
  • [Possible solution?](https://stackoverflow.com/questions/16522057/how-to-set-web-config-default-page-for-php-index-file) – halfer May 13 '15 at 23:53

1 Answers1

0

Try with

<configuration>
   <system.webServer>
    <defaultDocument>
        <files>
            <add value="index.php" />
        </files>
    </defaultDocument>
   </system.webServer>
</configuration>

in your web.config

Schlaus
  • 18,144
  • 10
  • 36
  • 64