Technically, when it comes to using file extensions in your URLs, it doesn't really make a difference which one you use for ranking purposes. .PHP, .HTML, .ASP, etc - it doesn't matter. But if you use image based file extensions for web page based file extensions, that might end up confusing Google Search for a period of time.
So if you use .GIF for an .HTML web page, that can end up confusing Google said John Mueller of Google. John wrote on Twitter "The only SEO effect I can think of is accidental file extensions that confuse things. Eg a web page that ends in ".gif" ... probably will have trouble being picked up for web-search. If UX says "no" & there's no SEO advantage, I'd skip it anyway."
Here is that tweet:
The only SEO effect I can think of is accidental file extensions that confuse things. Eg a web page that ends in ".gif" ... probably will have trouble being picked up for web-search. If UX says "no" & there's no SEO advantage, I'd skip it anyway.
— 🍌 John 🍌 (@JohnMu) July 21, 2021
I mean, that makes sense. Don't use a .JPG file extension for your .PHP web pages.
I do assume Google would figure it out over time but still, it just doesn't make sense.
Forum discussion at Twitter.