I am not sure if you just simplified for example, but make sure you use full URL in wp_redirect()
call.
Also rather than having it in template, I think it would be more appropriate to run this at template_redirect
hook.
I am not sure if you just simplified for example, but make sure you use full URL in wp_redirect()
call.
Also rather than having it in template, I think it would be more appropriate to run this at template_redirect
hook.