정보 :미리 렌더링 + AngularJS와 - 크롤러 시간 설정에 대한 아웃
내가 설치 한 사전 렌더링 (https://github.com/prerender/prerender) 성공적으로 내 자신의 서버, 우분투 16.
이 내 htaccess로는, 그것은 다시 작성됩니다 크롤러가 감지 될 때 URL을 미리 렌더링합니다. 예 : 사전 렌더링을 사용할 때
메타 데이터 스카이프 레딧, 센터로드되지 : http://www.example.nl/63/Merry는 http://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]
문제가된다. 오래된 PHP 웹 사이트에 URL을 다시 작성하십시오 : http://art.example.net (현재 htaccess에 주석 처리 됨)가 작동합니다. PHP와 Angular 웹 사이트의 모든 메타 태그가 동일하기 때문에 사전 확인자가 문제의 원인 일 가능성이 큽니다. 미리 렌더링을 사용하여 : (http://example.nl/63/Merry URL을 사용하여 https://cards-dev.twitter.com/validator) : 트위터에서
오류 예를
ERROR: Failed to fetch page due to: HttpConnectionTimeout
WARN: this card is redirected to http://example.nl:3000/http://www.example.nl/63/Merry
트위터 (또한 주요 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와 함께 작업하는 것이 좋습니다. Prerender는 Discord 및 Postman (수정 된 사용자 에이전트 헤더 포함)에서 작동합니다. 나는 왜 그것이 다른 몇몇 대리인을 위해 작동하지 않는지 왜 모른다.