Is it possible to get the filetype of a webpage. I see sometimes webpages like:
random.com/game
What is the filetype of game?
I can of course try to guess the filetypes, such as game.html, game.php etc. but is there a way to get it?
No, it's not possible. There are several reasons for this:
/game
could be a sub-directory. In this case, the file could be one of any default index pages for the web server serving the page.
/game
could be configured via server routing to point somewhere completely different on the site.
/game
could be a route in a web application. In this case, there's no single file for the page. The server could route the request to application code which uses any number of files to construct the page.