I'm using an angular.js app to fetch content via an external API. All works great, except for metadata and opengraph values. As we can't rewrite all metadata, we decided to use some redirection to send crawler on specific pages with metadata. We use this method : https://github.com/michaelbromley/angular-social-demo All seems to work, but when we need to get "route" params from .htaccess file, we don't have anything. We can send FB crawler on specific page, but without information.
Here is our .htaccess :
RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet)
RewriteRule the-page-with-angular-app.html(.*)$ http://www.oursite.net/some/directory/static-page.php?id=$1 [P]
Here is our URL :
http://www.oursite.net/the-page-with-angular-app.html#/someInfo/3437/46
Please note that our angular.js app need "#" in URL (for some reasons we can't use html5mode).
We want redirect to page : oursite.net/some/directory/static-page.php?id=someInfo/3437/46 at least, even if it could be better to redirect to oursite.net/some/directory/static-page.php?id1=someInfo&id2=3437&id3=46
For the moment, we just can redirect to oursite.net/some/directory/static-page.php (we can pass GET id if we force it in .htaccess). The rewrite cond works great.
Thanks for help,