Everything should be compatible with everything else, so in one sense it doesn't matter what gets connected to where.
In practice though, you should make sure that your SSD is connected via sata3. HDDs and optical drives won't come close to using all of the bandwidth in sata2, so they can go anywhere.