Can I deny access to a Wordpress directory with MVC 2?

Can I deny access to a Wordpress directory with MVC 2?

I have a directory in my website called /MyFiction. It is an installed version of Wordpress for a particular blog and I would like to keep it to where you can only get to it if you're authenticated. I'm an old hat to ASP.NET but with MVC I'm still a newbie....

Why can't I reference JavaScript files in my View?


How to construct HttpPostedFileBase?
Set the directory up in your web.config the way you would with standard ASP.NET, but make sure to ignore the route in your MVC web site via Application_Start..
How to resolve issue with image path when testing HtmlHelper?

Is a HTML helper a place for Business Logic?

Is this code business logic or presentation logic?


Sending collection of items in ASP.NET MVC
You could still use the <location> element in your web.config to restrict access to certain folders..
ASP.NET MVC forces an AJAX request be redirected to the login page when the FormsLogin session is no longer active

How to make a default editor template for enums?


I'm not sure if I'm right here, but have you tried dropping a web.Config file in the directory with permissions content?.
@tvanfosson said it right.

Standard Web Forms authentication is still valid as long as you remove the directory from your Routes..


You actually don't need to add.
because in MVC by default the setting routes.RouteExistingFiles is set to false so you can just drop web.config in the root folder that will deny access to all users.
    <configuration>       <system.web>         <authorization>           <deny users="?"/>         </authorization>       </system.web> ..... 

64 out of 100 based on 29 user ratings 804 reviews