rmartrenado
rmartrenado

Reputation: 1576

Facebook crawler doesn't follow my rewrite rule

I have this in my HTACCESS:

RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/1.1|Facebot|Twitterbot|Pinterest|Google.*snippet|/externalhit_uatext/)
RewriteRule /+(.*?)$ /api/getSocial.php?which=$1 [P]

And using the facebook debug tool with my website, I see that facebook is getting the url without being rewritten, which is very weird. This is the url:

http://lab.pre.rtve.es/carlos-v-ricardo/podcast/

¿Any ideas why the crawler is not following this redirect? ¿Has the name of the user agent changed for Facebook?

I can read in the official documentation that this should work.

Thank you very much.

Upvotes: 1

Views: 1586

Answers (1)

Cosmin
Cosmin

Reputation: 1490

In the https://developers.facebook.com/docs/sharing/webmasters/crawler it is also written the crawler can have the

facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)

useragent, and you do not cover that.

Upvotes: 1

Related Questions