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.

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

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.