1

I did not find which is the best following to serve physical files to the users in a MVC3 app. For example if I want to put my site in search engines, they ask me to place an xml file in the site root. This file can not be accessed because I think the routing does not "catch" the url...

Thanks¡¡

3 Answers 3

1

You should be able to ignore route:

routes.IgnoreRoute("/filename.xml");

Or:

routes.IgnoreRoute("filename.xml");

And that should be done in Global.asax file and RegisterRoutes() function

Sign up to request clarification or add additional context in comments.

Comments

1

did you try opening the file through your web browser? if you tried and it didn't open then you can do the following in global.asax write the following C# routes.IgnoreRoute("{xml}", new { xml = @"(.)?abc.xml" }); where abc is the file name or you can but * instead of abc to ignore all xml files

Comments

0

You can just set the permissions on the file system with a chmod (700) or equivalent. Usually this is where the protections come in.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.