如何在角度js项目中设置prerender?

时间:2016-11-18 07:09:34

标签: angularjs prerender

我正在尝试在我的角度js项目上设置prerender。以下是我的项目的.htacess配置

<IfModule mod_headers.c>
    RequestHeader set X-Prerender-Token mytokeniscorrect

<IfModule mod_rewrite.c>
    RewriteEngine On
        <IfModule mod_proxy_http.c>
                RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Googlebot|Google.*snippet|LinkedInBot|bingbot|Yahoo|MSNBot|YahooSeeker|baiduspider|rogerbot|embedly|quora\ link\ preview|showyoubot|outbrain|Slackbot|Slack-ImgProxy|Slackbot-LinkExpanding|Site\ Analyzer|SiteAnalyzerBot|Viber|WhatsApp|Telegram|woobot|woopingbog/1.1) [NC,OR]
        RewriteCond %{QUERY_STRING} _escaped_fragment_

        # Only proxy the request to Prerender if it's a request for HTML
        RewriteRule ^(?!.*?(\.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|\.ttf|\.woff))(.*) http://view9.com.au:3000/http://development.view9.com.au/stage/captivation-sport/captivation_v3/$2 [P,L]
    </IfModule>
</IfModule>

但是当我使用woo rank或google master测试时,我会看到以下结果。

enter image description here

你能告诉我我做错了吗?

0 个答案:

没有答案