Laying on side pregnancy

Is it just the last trimester you’re supposed to sleep on your back when pregnant?