0

I'm using the App Service to host a wordpress blog. When I search using my site's search engine I receive an Azure error. I'm assuming because the URL is too long as a safety feature to prevent injection attacks.

The error message is: "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

Nero
  • 33
  • 7
  • I found this: http://andredublin.github.io/.net/2014/06/26/large-query-string-values-and-azure.html – Nero Jul 19 '20 at 19:37

2 Answers2

2

Stealing part of this answer from @Shirin.

  1. Open your Azure Portal. Go to App Service which you are using to host word press. Click on Advanced Tools.
  2. Click Go. It will open Kudu App Service.
  3. Click on Debug console >> CMD.
  4. From the top explorer navigation, go to site/wwwroot and find your web.config file.
  5. Click edit
  6. It will open editor for you to edit your web.config file. Add security > requestFiltering > requestLimits.maxQueryString element. Also add system.web > httpRuntime.maxQueryStringLength element. I am giving example below.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <customErrors mode="Off"/>
    <httpRuntime maxQueryStringLength = "10000" />
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxQueryString="10000" />
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>
Nero
  • 33
  • 7
0

It seems you need to add a custom mime type into Azure App Service web.config file for the type of file you are searching.

  1. Open your Azure Portal. Go to App Service which you are using to host word press. Click on Advanced Tools. enter image description here
  2. Click Go. It will open Kudu App Service.
  3. Click on Debug console >> CMD.
  4. From the top explorer navigation, go to site/wwwroot and find your web.config file. enter image description here
  5. Click edit pencil icon.
  6. It will open editor for you to edit your web.config file. Add your mime type inside staticContent element. I am giving example below.
<mimeMap fileExtension=".mp4" mimeType="wp-content/themes/move-service/assets/video" />
<mimeMap fileExtension=".extension" mimeType="your_files_url" /> 
Shirin
  • 168
  • 1
  • 6
  • I think I am on the right track right now. You pointed me to the right config file -- but I think the settings are actually a security setting as described in this article. http://andredublin.github.io/.net/2014/06/26/large-query-string-values-and-azure.html – Nero Jul 19 '20 at 19:40