Chemistry - Fischer to Haworth projection: which carbon connects to the oxygen?
Solution 1:
It just is. There are pyranose and furanose forms for all aldoses and hexoses (given they are long enough), including glucose:
$\hspace{3cm}$
You will just have to remember which connections correspond to which sugars. You can read more about anomers ($\alpha$ vs. $\beta$) here, and more about carbohydrate chirality (D vs. L) here.
Solution 2:
All sugars attach to carbon n-1 when making pyranose rings, except for the ones with 4 carbon atoms. The reason being, a ring with four atoms wouldn't be stable (too much strain).