7:52 AM
hi there
 
So, describe what happens when you log on?
 
everythig resumes ack to normal
back
 
in your live environment?
so the issue you're having is just for un-authenticated users?
 
yes
basically - until you're authenticated everything (including resources like javascript and stylesheets) gets redirected to login page
 
7:56 AM
but locally you don't have that problem. strange.
What could possibly be different from local to live server?
 
I have a theory that it has something to do with hosting provider's default configuration
 
I haven't dealt with servers that I don't have control over, so I don't know what kinds of things are common
You're using Forms Authentication Method?
 
my understanding is that Web.config inherits some of the settings from the "upper context" configuration
yes
maybe I'd have to explicitly disable all other authentication methods?
 
If you're able, what if you set <authentication mode="None"> just to see if that works?
 
just a minute
khmm
 
8:03 AM
any change?
 
that locked me out entirely
401 - Unauthorized: Access is denied due to invalid credentials.

You do not have permission to view this directory or page using the credentials that you supplied.
 
okay
put it back to "Forms" and maybe try adding the following inside <system.web>
<authorization>
<allow users="?" />
</authorization>
See if that allows an unknown user to view a unprotected page
Can you say which hosting company this is?
 
intermedia
 
just curious if they have a default somehow to <deny users="?">
which would be pretty strange, actually
 
well... I restored the site to the "original" configuration
 
8:16 AM
do you use [Authorize] on just your ActionResult methods? It's not on any of your controllers is it?
 
it is on some of my controllers
 
if it's on the controller, it will affect all the Actions that belong to it; you realize that, right?
 
the funny effect was that as I tried to open the root url of my application
sure I realize it
the root url displayed the 401 page, but when I asked for example.com/myapp/Home/Index
 
i suppose if I were you, I'd temporarily remove all the [Authorize] attributes and then add them back in one at a time to make sure something isn't out of place
 
I got proper response
 
8:20 AM
hmm, okay in your Global.asax.cs file, what routes do you have? just the default?
 
nope.. I've modified them, but the last mapping is still the default one
btw - my app is not deployed as a root virtual directory
of the site that is
 
that's what I gathered from your example url
so you have something like
      routes.MapRoute(
          "Custom", // Route name
          "myapp/{controller}/{action}/{id}", // URL with parameters
          new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
      );
where there is a "myapp" contanst in the url string
or whatever you are using
can you copy/paste your entire global.asax.cs file?
 
no
the myapp does not figure in there
basicaly they are all variations of the default
 
OK, if your URL is going to include a folder such as example.com/myapp/Home/Index you'll need to account for that extra "folder"
Otherwise MVC would interpret myapp as the controller name, Home as the action, and Index as the Id
 
ermm... the app itself has ben deployed to the myapp folder of the hosting provider's site
that is - myapp is the root folder of the app and from that pov the routing is okay
basically, my app is deployed in this manner:
+- Site root (as an app running classic .NET)
   |
   +- Myapp (as an app running .NET 4)
   |
   +- Another app deployed in parallel (running classic .net)
 
8:38 AM
Yes, I think you'll need to add Myapp/ to the beginning of each of your route URLs
if the URL of the page contains it, it gets interpreted by the MVC routing mechanism
If that doesn't fix it, you may want to look at this: haacked.com/archive/2008/03/13/url-routing-debugger.aspx
 
well.. I have the same setup in local server and there the routing works
 
your URL locally also includes Myapp/?
 
Btw - in the parent folder `Web.config` file I have following snippet in `system.webServer` section:
<security>
<authentication>
<windowsAuthentication enabled="true" />
<basicAuthentication enabled="false" />
<digestAuthentication enabled="false" />
</authentication>
</security>
yes
 
maybe set windowsAuthentication to false
you're not using Windows Auth are you?
 
nope
i'll try that
 
8:44 AM
okay, that could do it
you may need basicAuthentication enabled instead
I'm going to have to sign off for the night soon.
 
okay
thanks
for the help
 
did that fix anything?
or are you able to change it?
 
9:14 AM
I actually found out the problem
and it had next to nothing to do with Web.config
basically, in the hosting provider's control panel I had to grant permissions for the anonymous (web) user to access files on the application physical folder