简体   繁体   中英

Sending Redirect Code to Facebook Sharer

Here is a permalink for a tweet on twitter:

https://twitter.com/#!/917thebounce/status/144914597537787904

Notice the hash symbol in the url. When I enter the url into Facebook's debugger tool: https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Ftwitter.com%2F%23%21%2FHYPERCRUSH%2Fstatus%2F144920720378568704

it appears as though twitter is sending back a 301 Redirect to a permalink that DOESN'T have a hash symbol. When I view the original link in my browser, I don't get the 301. I understand that the reasoning behind sending the redirect is so that it gives Facebook a proper url to scrape data from.

a) How might the twitter application know to redirect the Facebook scraping application but not a normal user visiting via a browser?

b) More importantly, how in the world might twitter know which non-hash url to redirect to? Since to my knowledge an http request does not include anything after the hash symbol, ie doesn't twitter only receive a request to https://twitter.com/ ? I must be wrong here.

Actually, its a " shebang " and is used to javascript based navigation. This is a google thing, so urls with shebangs actually can be indexed.

You should be able just to remove it and the request it through facebooks debugger tool, which means you should be able to send https://twitter.com/917thebounce/status/144914597537787904

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM