rechtlich
legal
Relating to the law or laws; juridical.
Bevor wir den Vertrag unterschreiben, sollten wir ihn rechtlich prüfen lassen.
Before we sign the contract, we should have it legally reviewed.

legal
Loading your saved state.
legal
Relating to the law or laws; juridical.
Bevor wir den Vertrag unterschreiben, sollten wir ihn rechtlich prüfen lassen.
Before we sign the contract, we should have it legally reviewed.

The adjective 'rechtlich' (legal) is derived from the noun 'das Recht' (the law). The ending '-lich' turns the noun into an adjective and here means 'relating to the law'.
Eine rechtliche Prüfung des Vertrags ist sehr zu empfehlen.
A legal review of the contract is highly recommended.
'Rechtlich' (legal) is often used in fixed combinations, for example 'rechtliche Schritte einleiten' (to take legal action), 'rechtliche Konsequenzen haben' (to have legal consequences), or 'eine rechtliche Grundlage schaffen' (to create a legal basis).
Wer ohne Erlaubnis baut, muss mit rechtlichen Konsequenzen rechnen.
Anyone who builds without permission must expect legal consequences.
As an adverb, 'rechtlich' (legally) often appears at the beginning of a sentence or after the verb and evaluates a situation from a legal point of view. A typical phrase is 'rechtlich gesehen' (legally speaking).
Rechtlich gesehen ist der Vertrag gültig.
Legally speaking, the contract is valid.
because of
'wegen' and 'rechtlich' overlap only in the fixed expression 'von Rechts wegen'. This expression means 'legally speaking' or 'according to the law'. 'rechtlich' is an adjective and fits when you are speaking generally about laws, rights, or permission. 'wegen' by itself normally gives a reason and has nothing to do with law. They can be confused because 'von Rechts wegen' sounds similar to a legal statement. Outside this fixed expression, you usually use 'rechtlich' for legal topics.

Ist diese Kündigung rechtlich überhaupt erlaubt?
Is this termination legally allowed at all?
Von Rechts wegen darf der Vertrag nicht einfach geändert werden.
By rights, the contract may not simply be changed.