Forum Discussion

Grant1979's avatar
Grant1979
Copper Contributor
Oct 29, 2022

Have Subdirectory of site show the index.html file when going to site .

Hello all! I am a fairly novice windows IIS guy, so any help I would greatly appreciate.

 

I have a client that requested all root Urls on their department websites redirect to their index.html page. So if a user, for example, goes to https://mysite.domain.com/ it will redirect to https://mysite.doman.com/index.html.

 

I was able to do this through IIS 10 using a URLrewrite rule on the root of each site by doing the following

</rule>
                <rule name="Index Request" enabled="true" stopProcessing="true">
                    <match url="^$" />
                    <action type="Redirect" url="https://mysite.domain.com/index.html%22 />
                </rule>

 

This seemed to work.

 

The client now wants to have any of the subfolders of the root site show the index.html to any subdirectory sites. Example. Https://mysite.domain.com/subdir/ “This is what shows now” to https://mysite.domain.com/subdir/index.html. Is there a way to do this in IIS?

 

I have made sure the index.html is the default document. I have also looked at User Friendly URL-template https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/user-friendly-url-rule-template, but I am not sure if this is the right direction to go.

 

Thanks in advance for any advice

 

 

Resources