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?

1:

How to construct HttpPostedFileBase?
Set the directory up in your web.config the way you would with standard ASP.NET, although make sure to ignore the route in your MVC web site via Application_Start.. How to resolve issue with image path when testing HtmlHelper?
 routes.IgnoreRoute("/MyFiction/{*pathInfo}"); 
Is a HTML helper a place for Business Logic?Is this code business logic or presentation logic?

2:

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?

3:

I'm not sure if I'm right here, although 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..

4:

You actually don't need to add.
 routes.IgnoreRoute("/MyFiction/{*pathInfo}"); 
for the reason this in MVC by default the setting routes.RouteExistingFiles is set to false so you must just drop web.config in the root folder this will deny access to all users.
    <configuration>       <system.web>         <authorization>           <deny users="?"/>         </authorization>       </system.web> ..... 


64 out of 100 based on 39 user ratings 634 reviews