Checking current path and applying redirection rules...
(The redirect uses window.location.replace() to ensure the back button works correctly on the new site.)
window.location.replace()