dimanche 19 avril 2015

RewriteRule in .htaccess for AngularJS prerendered posts

following this tutorial I'm trying to establish a rewrite rule for social bots in .htaccess, so my prerendered Angular SPA posts can be posted on social networks.


Prerendered posts seem to work fine:



http://ift.tt/1zxFeHz


However, the Facebook debugger still doesn't receive proper data from actual post link:



http://ift.tt/1cLGzpt


My .htaccess code:



ErrorDocument 404 /index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_USER_AGENT} (Facebot|Twitterbot|Pinterest|Google.*snippet)
RewriteRule service/(\d*) http://ift.tt/1zxFeHB [P]
</IfModule>


Would appreciate any suggestions in modifying the file.


Aucun commentaire:

Enregistrer un commentaire