情報:私は自分のサーバー上で正常に事前レンダリング(https://github.com/prerender/prerender)をインストールした事前レンダリング+ AngularJS - クローラのタイムアウト設定について
、Ubuntuの16
これは書き換えて、私の.htaccessですクローラが検出されたときにプレレンダリングするURL。例:http://www.example.nl/63/Merryhttp://example.nl:3000/http://www.example.nl/63/Merry
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_USER_AGENT} baiduspider|facebookexternalhit|twitterbot|redditbot|slackbot|msnbot|googlebot|duckduckbot|bingbot|rogerbot|linkedinbot|embedly|flipboard|tumblr|bitlybot|SkypeUriPreview|nuzzel|Discordbot|quora\ link\ preview|showyoubot|outbrain|pinterest [NC,OR]
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=$
RewriteRule ^(.*)$ http://example.nl:3000/http://www.example.nl/$1? [R=301,L]
#RewriteRule ^(.*)$ http://art.example.net/$1? [R=301,L]
RewriteRule ^(.*)/(.*)$ /#$1/$2 [NC,L]
問題になる:事前レンダリングを使用するとき
メタデータは、Skype、Redditに、Twitterでロードされていません。古いPHPウェブサイトのURLを書き直す:http://art.example.net(現在htaccessにコメントされています)が動作します。 PHPとAngularのウェブサイトにあるすべてのメタタグは同じであるため、問題解決の原因としては事前解決者が考えられます。事前レンダリングを使用した:(http://example.nl/63/Merry URLを使用してhttps://cards-dev.twitter.com/validator):Twitterから
エラー例
ERROR: Failed to fetch page due to: HttpConnectionTimeout
WARN: this card is redirected to http://example.nl:3000/http://www.example.nl/63/Merry
のTwitter(メインURL使用:http://example.nl/63/Merry)art.example.netにリダイレクト
INFO: Page fetched successfully
INFO: 19 metatags were found
INFO: twitter:card = summary_large_image tag found
INFO: Card loaded successfully
WARN: this card is redirected to http://art.example.net/63/Merry
をPHPバージョンを使用すると、すべてのメタデータがロードされます。
今後、私はPHPウェブサイトを完全に削除したいので、プレレンダリングを使用するのが大好きです。 PrerenderはDiscordとPostman(変更されたUser Agentヘッダー付き)で動作します。なぜ私はそれが他のエージェントにとってうまくいかないのか分かりません。