Yes, that will do it, but a header redirect will be much faster and easier, and won't fail even if your visitors have javascript off. If you running into a "Headers already send" error, use the ob_start() function at the beginning of your script, and ob_end_flush() at the end.