- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经在 Azure 网站中安装了 wordpress,它主要运行 Django。我已在应用程序设置中将应用程序设置为/blog 到/site/wwwroot/blog。
但是 web.config 不提供 URL www.example.com/blog,而是抛出 404 错误。
这是 web.config,您能否建议如何禁用 www.example.com/blog 的重写
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<appSettings>
<add key="WSGI_ALT_VIRTUALENV_HANDLER" value="django.core.wsgi.get_wsgi_application()" />
<add key="WSGI_ALT_VIRTUALENV_ACTIVATE_THIS" value="D:\home\site\wwwroot\env\Scripts\python.exe" />
<add key="WSGI_HANDLER" value="ptvs_virtualenv_proxy.get_venv_handler()" />
<add key="PYTHONPATH" value="D:\home\site\wwwroot" />
<!--
<add key="WSGI_PTVSD_SECRET" value="" />
-->
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<!-- Required for websockets. -->
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<remove name="Python340_via_FastCGI" />
<add name="Python FastCGI" path="handler.fcgi" verb="*" modules="FastCgiModule" scriptProcessor="D:\Python34\python.exe|D:\Python34\Scripts\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
<!-- Uncomment the following handler to enable remote debugging. -->
<!--
<add name="ptvsd" path="ptvsd" verb="*" resourceType="Unspecified" type="Microsoft.PythonTools.Debugger.WebSocketProxy, Microsoft.PythonTools.WebRole"/>
-->
<!-- <clear/>
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
-->
</handlers>
<rewrite>
<rules>
<!-- Uncomment the following rule to enable remote debugging. -->
<!--
<rule name="ptvsd" enabled="true" stopProcessing="true">
<match url="^ptvsd(/.*)?$"/>
</rule>
-->
<rule name="Static Files" stopProcessing="true">
<conditions>
<add input="true" pattern="false" />
</conditions>
</rule>
<rule name="Configure Python" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{REQUEST_URI}" pattern="^/static/.*" ignoreCase="true" negate="true" />
</conditions>
<action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<staticContent>
<clientCache cacheControlMaxAge ="7.00:00:00" cacheControlMode="UseMaxAge" />
</staticContent>
</system.webServer>
</configuration>
最佳答案
根据您的描述,建议您尝试在规则中添加不匹配条件。
如果url的目标是blob文件夹,则不会被重写。
更多详细信息,您可以引用下面的配置。
<rule name="Configure Python" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{REQUEST_URI}" pattern="^/static/.*" ignoreCase="true" negate="true" />
<add input="{URL}" pattern="^/blog/.*" ignoreCase="true" negate="true" />
</conditions>
<action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="true" />
</rule>
结果如下:
关于django - Azurewebsite django URL 重写另一个应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45343655/
在 Azure 网站上进行身份验证时,我遇到了回复 URL 的问题。正常登录时一切正常,但使用其他页面登录时会生成“回复 URL”错误。 例如,使用“https://xxxxx.azurewebsit
我在 Azure 中创建了使用 *.azurewebsites.net 内置证书的 Web 应用程序。 SSL 在这里工作得很好。 我最近创建了另一个网络应用程序,它使用的证书是 MYSITE.azu
我有一个站点调用 https://[site-name].azurewebsites.net 。我只想从整个链接中删除 .azurewebsites 所以它看起来像 https://[site-nam
我完全遵循description by Microsoft将他们的网络应用程序映射到自己的外部域上。而且重定向是正确的。 但我的目的是将 mydaylivery.com 映射到 mydaylivery
为了避免 azurewebsites.net 上的命名空间冲突,我在我的网站上添加了一个字符串前缀。例如 foo-app1.azurewebsites.net 和 foo-app2.azurewebs
您好,我已将 GoDaddy 域上的 A 记录和 C 名称设置为 Azure 应用服务(网站)。在 Azure 门户中,它还显示已成功验证域名。但是,当我在浏览器地址栏上输入 .com 时,它会正确加
我对同一订阅中的三个 Azure 网站发生的情况感到有点困惑。 我有 网站1(通过 x.azurewebsites.net) website1-stage(通过 x-stage.azurewebsit
我已经在 Azure 网站中安装了 wordpress,它主要运行 Django。我已在应用程序设置中将应用程序设置为/blog 到/site/wwwroot/blog。 但是 web.config
CORS 表示: A web application executes a cross-origin HTTP request when it requests a resource that has
我的项目看起来像这样: ├── Bower.json ├── src │ ├── Bower_Components │ ├── 图片 │ ├──index.html │ ├──scripts.min.
我们的公司网站托管在 Windows Azure 网站上,并为我们的域设置了 A 记录。 问题是,人们也可以使用 http://azurewebsites.net 的 mangomint 子域访问我们
我在共享模式 Azure 站点上设置了一个自定义域,其中 CNAME 为 www.lakestarlodge.com,A 记录为 Lakestarlodge.com。两者都有效 - 我可以在浏览器中输
我们的网站托管在 Windows Azure 中,默认域名 (xxx.azurewebsites.net)。我们使用 SendGrid 发送电子邮件。我们想要对电子邮件链接进行白标。 This页面显示
New-AzureWebsite Cmdlet - New-AzureWebsite [[-Name] ] [[-Location] ] [[-Hostname] ] [[-Publishing
我们的网站托管在 Windows Azure 中,默认域名 (xxx.azurewebsites.net)。我们使用 SendGrid 发送电子邮件。我们想要对电子邮件链接进行白标。 This页面显示
我有一个用 CakePHP 构建并托管在 http://thecontrolist.azurewebsites.net 上的网站.我正在使用 git 来更新这个网站。我正在使用 Coco 主题,它使用
我写了如下代码。当我将其发布为 cloudapp.net 时,它可以工作,但当我将其发布为 azurewebsites.net 时,它会抛出 SEHException。 String val = Ro
我有几个 (4) Web 应用程序在 Azure 上运行:其中 3 个需要很少的处理能力,因此,它们一直在运行免费计划;而另一个是针对最终用户的,这意味着更高的负载并且需要自定义域和 SSL 证书。
我有两个 Azure 帐户。使用第一个帐户,我创建了一个应用服务(URL 上的 ASP.NET Core Web 应用程序:[something].azurewebsites.net)。然后我决定将其
我正在调整上传到我的网站的图像的大小,我正在使用 Azure Blob 存储来存储物理文件,并且我通过公共(public)容器或私有(private)容器(取决于图像)。 我发现以下教程描述了 Ima
我是一名优秀的程序员,十分优秀!