Redirect index.html and non www to www using web.config

I use a standard web.config file in my projects which are hosted on Windows servers. Now i need to redirects non www url to www with https and remove the index.html from the url.

<system.webServer>
    <rewrite>
        <rules>
            <rule name="Redirect http://visasimple.com to https://www.visasimple.com HTTP" patternSyntax="ECMAScript" stopProcessing="true">
                <match url=".*"></match>
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^visasimple.com$"></add>
                    <add input="{HTTPS}" pattern="off"></add>
                </conditions>
                <action type="Redirect" url="https://www.visasimple.com/{R:0}" redirectType="Permanent" appendQueryString="true"></action>
            </rule>
            <rule name="redirect index.html" stopProcessing="true">
                <match url="^(\w*/)?index\.html" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="visasimple\.com$" />
                </conditions>
                <action type="Redirect" url="https://www.visasimple.com/{R:1}" />
            </rule>
        </rules>
    </rewrite>      
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>

How to remove index.php from URLs in Joomla

To enable Use URL rewriting in Joomla, you should do the following:

  • Log into your Joomla dashboard.
  • In the left menu, click on the Global Configuration link under the SYSTEM tab.
  • There are several tabs at the top of the page. If you are not on the Site tab, click Site.
  • On the right side of the page, find theSEO Settings.
  • Set Use URL rewriting option to Yes.

You should enable Use URL rewriting in Joomla 3.x. and rename htaccess.txt to .htaccess.