Reputation: 3483
I have created Angularjs app and hosted in an IIS server. I used prerender.io for SEO and it works really well.
But I have a problem with sharing my web site on facebook. It gives me following errors when I try on facebook debugging tool.
https://developers.facebook.com/tools/debug
web.conf
<rule name="RemoveTrailingSlash" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>
<rule name="HotelRedirectRulesLenon1" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^example.(com|net|com.au)$" />
</conditions>
<action type="Redirect" url="http://www.example.org" />
</rule>
<rule name="HotelRedirectRulesLenon2" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^www.example.(com.au)$" />
</conditions>
<action type="Redirect" url="http://www.example.org/{R:0}" />
</rule>
<rule name="AngularJS" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/index.html" />
</rule>
<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|\.doc|\.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>
<action type="Rewrite" url="http://example/{R:2}" />
</rule>
Upvotes: 0
Views: 235
Reputation: 1604
I responded to your email but wanted to respond here too in case anyone else has similar issues.
First, You shouldn't be doing a 301 redirect to http://service.prerender.io/. The proxy should happen behind the scenes so that the crawler has no idea you are using Prerender.io. If you 301 redirect, you are telling the crawler that you should send users to our service and that is incorrect.
Also, you are setting window.prerenderReady = false and never setting it to true so that means we are going to wait until we hit our timeout to return the page. That's causing Facebook to timeout.
Upvotes: 1