Can wixLocation be used in site code?

Hey
I am trying to make a user check in Site Code but with no luck.

wixLocation.to(“/about-me”);

Is that code not usable in Site Code just Page Code? I can’t find anything about any restrictions of this inside the docs.

EDIT:
It seem that in Site Code you will have to enter a fully qualified domain url not just /page-url but the whole https://www.domain.com/page-url to make it work. Any comments from the team?

Is that a regular page or a members area page?

It is a regular page but I want to redirect if users are not logged in and it works with full url not only /page-url

Andreas, I have the below line of site (so not page) code which I unremark if I have to do maintenance and it works well. Relative URL´s are supported:

// wixLocation.to(“/maintenance”);