Redirect to subdomain

I am putting my new ghost site at www.domain.com and moving existing content to subdomain.domain.com. Is this possible with redirects.json?

{
		"from": "/path",
		"to": "https://subdomain.domain.com/path",
		"permanent": true
	}
]

Ignore, turns out it was a browser caching issue. Works in incognito window.

My case is not about sub-domains but the solution should be same… You mean that if I move my website from olddomain.com to newdomain.net,
all I have to do is change the domain in Ghost CLI and then add
this to redirects.json?

{
		"from": "https://olddomain.com",
		"to": "https://newdomain.net",
		"permanent": true
	}

I want to keep all external links active. Meaning if someone has linked a post with olddomain.com/tag1/post2 , that link when click should automatically go to newdomain.net/tag/post2.

Correct?