turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 155 forks source link

error 404.0 when trying to access added static file type (*.mem) #385

Closed rkuerbitz closed 5 years ago

rkuerbitz commented 5 years ago

I have the problem that after adding i18n to my project, IIS will not serve additional static file types added via web.config:

<system.webServer> <staticContent> <mimeMap fileExtension=".mem" mimeType="application/octet-stream" /> </staticContent>

Browsers will not download .mem files - I get an 404 error. I tried

i18n.LocalizedApplication.Current.UrlsToExcludeFromProcessing = New System.Text.RegularExpressions.Regex("(.mem)$")

but this doesn't help. I also tried setting i18n.UrlLocalizer.UrlLocalizationScheme = i18n.UrlLocalizationScheme.Void - this helps and shows me that the cause must be somewhere in i18n. It seems to me that somehow, when using i18n, the added fileTypes in staticContent are ignored. Could this be the case? If so, what can I do to make this work again?

Any help would be greatly appreciated, because i18n has been a blessing for me so far.

turquoiseowl commented 5 years ago

Are you saying the problem is URL-related?

Please provide details of what URLs work (after setting tweaks etc.) and what URLs don't along with response status.

Static content has popped up here often in the past so suggest you search though all past issues if you haven't already done so.

Browser caching of static content complicates the matter, so helps to have caching disabled in your browser when diagnosing.

Other refs: https://github.com/turquoiseowl/i18n/issues/109#issuecomment-34036587 https://github.com/turquoiseowl/i18n#static-file-compression-and-i18n https://github.com/turquoiseowl/i18n/issues/163#issuecomment-68811808

rkuerbitz commented 5 years ago

Hi Martin, thanks for responding so quickly. I already had checked the refs you mentioned and browsed all relavant issues. Anyway, I decided to change my app to the Void scheme - so now it works and I got rid of all the exclusions associated with URL Localization. If I may suggest something: could you add to the doc a little explanation that the Void scheme will work just fine as "cookie-based" mode. For me, using the Void scheme at first seemed risky (just because it wasn't explained more). That said, I really enjoy i18n and have a really smooth translation workflow using POEdit. Great work!

turquoiseowl commented 5 years ago

Thanks for the feedback and I'm pleased you've got a solution.

WRT the docs, I always think README contributions from users is the best sort, so would be pleased to receive some text from you which I can add, or even better a Pull Request with the same.