This is a legal ticket, and it's normally referred to as end-on-end. The problem is that in the event of problems which causes you to miss flights on the 2nd ticket - you'll have a lot less recourse than if the entire itinierary was on a single ticket.
Linking both tickets together for the purpose of checking through luggage is fine, but just be aware of your increased vulnerability in the event of a misconnect. I'd suggest purchasing travel insurance.