I cannot use htaccess. I need to use something like
"if(document.location.href.indexOf('/m/') > -1)"
to redirect from xxx.com/m/xxx/xxx.html to m.xxx.com/xxx/xxx.html.
I need to it to work for all url's that contain /m/.
EXAMPLE: example.com/m/folder1/article1.html
REDIRECT TO: m.example.com/folder1/article1.html
Thank you for any help.