i have regular html site what work on iis. after i add web.config file, for rewrite, i have multiple header and footer.
if i not have web.config file for rewrite site work but evry time when you refresh page come 404 error. here is my html and web.config:
`<HTML>
<HEAD>
<TITLE>Gaia kooli tunniplaani infosüsteem </TITLE>
<META NAME="Generator" CONTENT="Gaia kool 2024">
<META NAME="Author" CONTENT="Gaia Kool">
<META NAME="Keywords" CONTENT="Gaia kooli tunniplaani infosüsteem">
<meta http-equiv="expires" content="0">
</HEAD>
<script>
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
var urlPath = document.location.pathname;
var lastSlashIndex = urlPath.lastIndexOf('/');
urlPath = urlPath.substr(0, lastSlashIndex + 1) + event.data;
window.frames['main'].location.href = document.location.protocol + '//' + document.location.host + '/' + urlPath;
}
</script>
<frameset rows="72,50,*,30" border="0" framespacing="0" frameborder="0">
<frame src="frames/title.htm" scrolling=no>
<frame src="frames/navbar.htm" scrolling=no>
<frame src="welcome.htm" scrolling=auto name="main">
<frame src="frames/fuss.htm" scrolling=no>
</frameset>
<body>
<noframes><p>This page uses frames but your Browser does not support them.</noframes>
</body>
</HTML>`
and web.config:
`<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>`
thanks for help!
New contributor
Kaimar Kolk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.