简体   繁体   English

称为“工作”的路由在Azure中不起作用

[英]Route called “jobs” does not work in Azure

On my web site I previously had a page located at "/careers". 在我的网站上,我以前有一个页面位于“ / careers”。 I recently decided to rename this page to "/jobs". 我最近决定将此页面重命名为“ / jobs”。 Now when I try to access this page on my published Azure Web Site I just get a 403 response with the following error: 现在,当我尝试访问已发布的Azure网站上的此页面时,我仅收到403响应,并显示以下错误:

You do not have permission to view this directory or page.

It works on my local dev machine, and it works if I rename the action to "jobs". 它可以在我的本地开发机器上工作,并且如果我将操作重命名为“ jobs”,它也可以工作。 Why am I not allowed to create a route called "jobs"? 为什么不允许创建名为“工作”的路线? Is this reserved in Azure for some bizarre reason? 是否出于某些奇怪的原因而在Azure中保留了它?

// Does not work
public ActionResult Jobs()
{
    return View("jobs");
}

// Does work
public ActionResult Jobs2()
{
    return View("jobs");
}

From what I can tell, my routes should not be preventing me from using this action, and I don't have any sub-directories called "Jobs" in either my Views folder or my Controllers folder. 据我所知,我的路线不应阻止我使用此操作,并且我的Views文件夹或Controllers文件夹中没有任何名为“ Jobs”的子目录。

Edit: 编辑:

I just noticed that the issue is not actually "/jobs", but rather "/jobs/". 我只是注意到问题实际上不是“ / jobs”,而是“ / jobs /”。 For some reason Chrome was redirecting me to "/jobs/" (probably due to history). 由于某种原因,Chrome将我重定向到“ / jobs /”(可能是由于历史原因)。 I tried the same for other routes and it works fine. 我在其他路线上也尝试过,但效果很好。

/features (works)
/features/ (works)
/jobs (works)
/jobs/ (does not work)

通过使用FTP在Azure上访问我的网站,我现在可以看到实际上在Azure上上传了一个“作业”文件夹(该网站的较旧版本留下的文件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM