Let's say I have a dummy website URL: http://company.com/something.
I need to grab the path: /something and use a switch case to redirect to a new URL using javascript.
Can someone please guide me?
var URL;
var url_param = location.pathname;
switch(url_param) {
case "/how-to-do-this":
URL = '/your-new-destination/';
default:
URL: '/thankyou/';
console.log("your new URL is: " + URL);
Thanks.