Verification error for prerender.io with IIS

46 Views Asked by At

I'm trying to set up my web.config for my windows-shared IIS server in order to connect prerender.io, however struggling with verification issue, I've double checked my token, also I checked HTTP request for bots and it's working fine. I'm using hostgator windows-shared hosting. I would appreciate any help, because I'm trying to solve this for 3 days. Worth to mention, that my website was created with React and React-Router.

My web.config:

<?xml version="1.0"?> 
<configuration> 
    <system.webServer> 
        <httpProtocol> 
            <customHeaders> 
                <!-- Set the X-Prerender-Token header with your actual token value --> 
                <add name="X-Prerender-Token" value="MY_TOKEN" /> 
            </customHeaders> 
        </httpProtocol> 
        <rewrite> 
            <rules> 
                <!-- Rule for Prerender.io --> 
                <!-- Only proxy the request to Prerender if it's a request for HTML --> 
                <rule name="Prerender" stopProcessing="true"> 
                    <match url="^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent))(.*)" ignoreCase="false" /> 
                    <conditions logicalGrouping="MatchAny"> 
                        <add input="{HTTP_USER_AGENT}" pattern="baiduspider|facebookexternalhit|twitterbot" /> 
                        <add input="{QUERY_STRING}" pattern="_escaped_fragment_" ignoreCase="false" /> 
                    </conditions> 
                    <!-- Rewrite to Prerender.io service --> 
                    <action type="Rewrite" url="https://service.prerender.io/https://elite-arrival.com/{R:2}" /> 
                </rule> 
 
                <!-- React Router rule --> 
                <!-- All requests not matching a file will serve index.html --> 
                <rule name="ReactRouter" stopProcessing="true"> 
                  <match url=".*" /> 
                  <conditions> 
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
                  </conditions> 
                  <action type="Rewrite" url="index.html" /> 
                </rule> 
            </rules> 
        </rewrite> 
    </system.webServer> 
 
    <!-- The system.web section is for .NET framework configurations --> 
    <system.web> 
        <!-- Compilation settings: tempDirectory is optional and specifies where to store temporary files --> 
        <compilation tempDirectory="D:\InetPub\vhosts\elite-arrival.com\tmp" /> 
    </system.web> 
 
</configuration>

enter image description here

enter image description here

0

There are 0 best solutions below