0

Angularjs アプリを作成し、IIS サーバーでホストしました。私は prerender.io を SEO に使用しましたが、非常にうまく機能しています。

しかし、Facebook で自分の Web サイトを共有するのに問題があります。Facebook デバッグ ツールを試すと、次のエラーが表示されます。

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>
4

1 に答える 1

1

あなたのメールに返信しましたが、他の誰かが同様の問題を抱えている場合に備えて、ここでも返信したいと思います.

まず、 http://service.prerender.io/への 301 リダイレクトを行うべきではありません。クローラーが Prerender.io を使用していることを認識できないように、プロキシはバックグラウンドで実行する必要があります。301 リダイレクトを行うと、ユーザーを当社のサービスに誘導する必要があることをクローラーに伝えることになりますが、これは正しくありません。

また、window.prerenderReady = false を設定していて、決して true に設定していないため、タイムアウトに達するまで待機してページを返すことになります。これにより、Facebook がタイムアウトします。

于 2015-07-17T15:40:02.197 に答える