- 23 Mar 2023
- 1 Minuto para leer
- Colaboradores
- Impresión
- OscuroLigero
- PDF
Microsoft - IIS server
- Actualizado en 23 Mar 2023
- 1 Minuto para leer
- Colaboradores
- Impresión
- OscuroLigero
- PDF
Example premise
Important: Replace the example domain with your own document360 provided domain/custom domain.
- Example domain represented using
example.document360.io
and the subfolder/subdirectory path (/help) asexample.document360.io/help
Pre-requisites:
- Application Request Routing module for IIS
Know more → - URL Rewrite Module for IIS
Know more →
To set up a sub folder path
Install the URL Rewrite module for IIS Server
Install the Application Request Routing module, and ensure it is enabled
Add the following rewrite rule in
web.config
to rewrite contents from your documentation at/help
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxy_HomePage" enabled="true" stopProcessing="true">
<match url="^help$" />
<action type="Rewrite" url="https://example.document360.io/v1" />
<serverVariables>
<set name="HTTP_requested_by" value="proxy" />
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
<rule name="ReverseProxy_DocsPage" enabled="true" stopProcessing="true">
<match url="^help/(.*)" />
<action type="Rewrite" url="https://example.document360.io/help/{R:1}" />
<serverVariables>
<set name="HTTP_requested_by" value="proxy" />
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding">
<match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
<action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
</rule>
<rule name="RewriteLinksToSourceDomain1" preCondition="ResponseIsHtml">
<match filterByTags="None" pattern="^https://example.document360.io/(.*)" />
<action type="Rewrite" value="https://example.com/{R:1}" />
</rule>
<rule name="RewriteLinksToSourceDomain2" preCondition="ResponseIsHtml">
<match filterByTags="None" pattern=""/help"" />
<action type="Rewrite" value=""/help"" />
</rule>
<rule name="RewriteLinksToSourceDomain3" preCondition="ResponseIsHtml" patternSyntax="ECMAScript">
<match filterByTags="A" pattern="(.*)/docs/(.*)" />
<action type="Rewrite" value="/help/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
<preCondition name="NeedsRestoringAcceptEncoding">
<add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=" .+" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
What happens next?
Once you have successfully configured the web server, your knowledge base site is live on your custom subfolder/subdirectory.
However, the existing URL for your project will serve the requests.
For example,
example.document360.io
andexample.com/help
(if/help
is your folder path) will point to the Knowledge base site.
This will cause duplicate content in Search engines (Google, Bing, and more.). For this, you will need to enable a URL redirect. To enable the redirect from example.document360.io
to example.com/help
, please contact us at support@document360.com.