月根据当地时间重定向Javascript

I am developing a site and have been told based on the certain month we want to direct users to month specific pages. January will go to January.html, for example, February to February.html. I have created the following script and for some reason cannot redirect the page.

Any help would be greatly appreciated! Thanks, Nick

<p><script type="text/javascript">

function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++)
this[i+1] = initArray.arguments[i];
}

   var MonthArray = new;
   initArray("January","February","March","April","May","June","July","July","August",
   "Septemb er","October","November","December");
var today = new Date();
var m = MonthArray[today.getMonth()+1];

var currentDate = new Date().getDate();
if (currentDate == 1)
    window.location = "CORPORATE.COM WEBSITE/folder/january.html";
if (currentDate == 2))
    window.location = "CORPORATE.COM WEBSITE/folder/february.html";
if (currentDate == 3))
    window.location = "CORPORATE.COM WEBSITE/folder/march.html";
if (currentDate == 4))
    window.location = "CORPORATE.COM WEBSITE/folder/april.html";
if (currentDate == 5))
    window.location = "CORPORATE.COM WEBSITE/folder/may.html";
if (currentDate == 6))
    window.location = "CORPORATE.COM WEBSITE/folder/june.html";
if (currentDate == 7))
    window.location = "CORPORATE.COM WEBSITE/folder/july.html";
if (currentDate == 8))
    window.location = CORPORATE.COM WEBSITE/folder/august.html";
if (currentDate == 9))
    window.location = "CORPORATE.COM WEBSITE/folder/september.html";
if (currentDate == 10))
    window.location = "CORPORATE.COM WEBSITE/folder/october.html";
if (currentDate == 11))
    window.location = "CORPORATE.COM WEBSITE/folder/november.html";
if (currentDate == 12))
    window.location = "CORPORATE.COM WEBSITE/folder/december.html";
</script></p>

I think you might have more code there than you actually need.

In order to get the current month as digits, you can use this:

var dt = new Date();
var currentDate = currentDate.getMonth() + 1;

You can then use

if (currentDate == 1) [...]

The way you intended.

As a sidenote, it would be more clear (and more proper) to use a switch instead of countless if() statements:

switch(currentDate){
    case 1: window.location.href='/somesite/january.html';
    case 2: window.location.href='/somesite/february.html';
    case 3: window.location.href='/somesite/march.html';
    case 4: window.location.href='/somesite/april.html';
    /* and so on */
}

Maybe you're trying to overcomplicate everything. You can achieve this with one line of PHP. Here's one line of code that WILL work.

<?php header('Location:'."http://www.example.com/".date(F).".html");?>