0

I want my site to be hosted like this:

mysite.com/en/default.aspx
mysite.com/en-gb/default.aspx
mysite.com/de-ch/default.aspx

Originally I just hosted the site in application folders in IIS for each culture I support and everything was fine. I had a separate application in the root which forwarded the user to the appropriate culture. This was all grand.

However, now we're going to host with Azure and I need to get my site to fit into one web role (for those not familiar with Azure, just think of it as me only being able to host the website once - so no application folders). To this end, my site correctly collects the webfolder for the culture and sets the threading appropriately, all this is fine. My problem is that now as far as IIS is concerned the page 'default.aspx' does not exist in the folder 'en-gb'. That folder doesn't really exist. I need to get my site to ignore that first webfolder when it considers what content to get.

It's an interesting one, I suspect my solution lies in URL rewriting. Does anyone have any advice on this?

Thanks for the help!

4

1 回答 1

0

好吧,我找到了答案。

事实证明,网络角色的能力远不止于此。我知道这是一个在虚拟机下运行的网站,但该虚拟机可以随时拆除和移动。但是,有一个工具可以控制项目中该虚拟机上的 IIS 中发生的事情。通过编辑您的 ServiceDefinition.csdef 文件,您可以添加虚拟应用程序和虚拟目录。更多细节在这里: http: //www.dotnettwitter.com/2012/03/publishing-multiple-sites-sub-sites.html

我不需要使用任何花哨的 URL 重写。我现在有几个站点在一个 Web 角色下运行。

好吧......一旦我弄清楚是什么阻止了我的主站点在 Azure 下工作,我就会这样做,但这个问题已经得到解答。

于 2013-07-24T16:36:10.307 回答