0

I am using Owin File System to host static files. I got some information from the following:

Using a wwwroot folder (ASP.NET 5 style) in ASP.NET 4.5 project

I am good with hosting static files from wwwroot. There is a index.html which the URL fetches back.

However what I need is another website called wwwroot2 to be hosted under same application. How do I achieve that? I tried duplicating the about code for new file system. That doesn't work.

Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
Vish
  • 1
  • 1
  • You need another *website* to run under `wwwroot2`? That doesn't make any sense. The wwwroot folder is for serving static files in an application, not for hosting websites in an application – Camilo Terevinto Oct 18 '18 at 01:15
  • let me explain little more.When I try to load the site using 'http://localhost', index.html is retrieved. This works as expected. Now, I want to fetch index2.html under wwwroot, using 'http://localhost/index2.html'. This doesn't work. I see, it still retrieves index.html(not sure why this is happening). Now index2.html has its own css,js files which itself can be a single page website. – Vish Oct 18 '18 at 03:53
  • Which service are you using? ISS,Apache , etc. – yusuf hayırsever Oct 18 '18 at 07:26
  • its a ASP .NET server... turns out I am hitting https://github.com/facebook/create-react-app/issues/2398. the static pages (index.html) are npm build output of a react app. there is a service-worker.js that always loads irrespective of the path you specify. It goofs up the URIs. – Vish Oct 18 '18 at 19:35
  • Heres whats happening. service-worker.js is cached in the browser once index.html is loaded. This stays in the cache even when I closed the browser. For all the new pages(index2.html), the site tries to load all references of this service-worker.js (which was cached when index.html loaded) which could lead to something unintentional. In my case, this service-worker.js was trying to load lot many files and other static files apart from index2.html. I deleted the service-worker.js from the server, service-worker.js on the browser and it started working as expected. – Vish Oct 19 '18 at 21:14

0 Answers0