This tutorial covers the adjustments to your Web server required for creating a reverse proxy in IIS.  This allows for your location landing pages to appear under a sub-directory of your Web site such as www.yourwebsite.com/locations as opposed to locations.yourwebsite.com or other address.

This tutorial is for IIS running on Windows 2008 R2.  Other operating systems and Web servers will differ.

The first step is to Install IIS Rewrite.  This can be downloaded here, or via the Web Platform Installer by searching for Rewrite.  This will also require that you install Application Request Routing.  Once installed, click URL Rewrite:

Next, add the Rewrite rule that will redirect requests to "/locations" to our reverse proxy.

Choose Reverse Proxy

Enter the hostname where your current location landing pages appear.  The content at this address will be displayed when you visit "yourwebsite.com/locations"

This reverse proxy will match ALL URLs at this point.  We want to change this behavior to only match URLs beginning with /locations (or whatever sub-directory you choose).  Update the Pattern option as shown below:

That should complete the configuration.  Our complete Web.config was as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
 <rewrite>
 <rules>
 <rule name="ReverseProxyInboundRule1" stopProcessing="true">
 <match url="locations(/.*)?" />
 <conditions>
 </conditions>
 <action type="Rewrite" url="https://testlandingpagesrewrite.locationlandingpages.com/0-1111/{R:1}" />
 </rule>
 </rules>
 </rewrite>
 </system.webServer>
</configuration>

 

 

Did this answer your question?