I created simple application using Angular JS template engine but when I share the url in social media contents are not parsed it shows '{{}}' so I worked around using htaccess. whenever facebook requests my http://website.com/posts/value-1 I want it to redirect to static php file at http://website.com/static.php?id=$1 but it is not redirecting using the below htaccess file , Any Solutions ?
RewriteEngine on
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /pages/index.html
Redirect /index.html http://website.com/home/
RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9](+http://www.facebook.com/externalhit_uatext.php)|Twitterbot|Pinterest|facebot/[0-9]|Google.*snippet)
RewriteRule ^posts/(.*)$ http://www.website.com/static.php?id=$1 [NC,L]