0

I have an ASP.NET MVC 4 app that runs in IIS 7.5 on Windows Server 2008 R2 the site loads fine images show, javascript & css link tags when click shows 403 - forbidden access. I already tried lots of fix that I googled such as Installing the Static Content in the Role Service which is now installed also put in the runAllManagedModulesForAllRequests=true in the config. also set the folder security of my website in the wwwroot to Full Control for IIS_IUSR and Everyone and inherit them to subfolders and files but stil nothing.

dont know why it does not work in windows server 2008. But in my windows 7 running iis 7 it works fine css & javascript renders just fine.

Please help..

Patrick87
  • 237
  • 1
  • 2
  • 10
  • Are you use and CDN ? – dotnetstep Jun 29 '14 at 03:23
  • nope its on Azure its a virtual machine running windows server 2008 R2 Datacenter edition. the DB and the IIS is running on the same machine. – Patrick87 Jun 29 '14 at 03:27
  • Are you facing issue on Virtual machine it self or when you try to access that website from outside ( http://localhost or http://yourdomain ? Also try to access js file directly from url and provide info that does it give to same error. – dotnetstep Jun 29 '14 at 03:34
  • smae issue either locally or using my domain outside the server – Patrick87 Jun 29 '14 at 04:02
  • Link 1 : http://stackoverflow.com/questions/2374957/asp-net-mvc-on-iis-7-5 Link 2: http://stackoverflow.com/questions/6011636/403-forbidden-on-basic-mvc-3-deploy-on-iis7-5 – dotnetstep Jun 29 '14 at 08:41
  • Hi.. I already did that that's why I was able to run it in win7 and also in win2008R2.. also set the DefaultAppPool.. it renders the page just fine also can click links which does routing inside also fine, images are fine, but css and js links are the problem.. they wont.. the link when you view source from the browser shows a guid instead of a relative path which is wat is shown in my win7 when u view source – Patrick87 Jun 29 '14 at 15:31

1 Answers1

0

I would like to suggest one thing.

As you have tried all possible option like aspnet_regiis -i

I would like to test one more option.

Add your site in internet explorer trusted site list.

Internet Option -> security -> trusted sites ( click buttion sites)

Add your site with domain name into that and access it.

Also it would be nice if you provide where you hosted your css and js file. ( Is it hosted on diffrent site on same site content ?)

dotnetstep
  • 17,065
  • 5
  • 54
  • 72
  • Hi thanks 4 ur answer its on the same site. a typical asp.net mvc app – Patrick87 Jun 30 '14 at 14:09
  • Can you please provide html that get render for your JS include ? Also if you are using Bundle Configuration mvc then try to do without compression – dotnetstep Jun 30 '14 at 14:17