简体   繁体   中英

Sitecore: how to bypass MVC routing to allow direct access to a file/folder?

I have a Sitecore C# MVC/.Net 4.5 application. I have a Javascript file that needs to be accessed by external sources.

As it is not part of any route, I get a 404 if I try to access it directly, even with the file existing.

How can I allow external access to this file?

By default you should be able to access those files. Check here.

Why CSS and JS files bypass Asp.Net MVC routes?

If not then you might have (or someone) altered the " Handlers " Section of your web.config.

Or have the setting added, which routes all static files from the mvc pipeline.

<modules runAllManagedModulesForAllRequests="true" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM