Quantcast
Viewing latest article 2
Browse Latest Browse All 2

URL Rewrite based on User-Agent header

You can optimize content by delivering only Open Graph meta tags to the crawler and only the content itself to regular users. [source]

I'm trying to identify Facebot(Facebook's crawler) so I can serve it the meta tags. To do that, I'll need to be able to do rewrites based on User-Agent header.

I went through the Firebase documentation, but it seems to me that I can only do rewrites based on request url.

Another approach that comes to mind is to decide which content to serve within a firebase function. But I can't figure out how to fall back to index.html from a firebase function.

So in short: How would you serve the Open Graph tags just to Facebot using the Firebase ecosystem?


Viewing latest article 2
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>