301 Redirect from Wix to WordPress

后端 未结 3 1614
花落未央
花落未央 2021-01-24 01:50

A company I\'m working for had a WIX based site. I recreated the site on WordPress moved the hosting and redirected the domain. I then attempted to do the page redirects to the

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-24 02:42

    I had the same situation. The only solution I found is to create redirect.js file with the following content:

    var hashesarr = { "#!about-us/c1it7":'/about-us/',
    "#!patio-covers/ce54":'/patio-covers/',
    "#!lattice/c1mz":'/patio-covers/lattice/' };
    
    for (var hash in hashesarr) {
        var patt = new RegExp(hash);
        if (window.location.hash.match(patt) !== null) {
            window.location.href = hashesarr[hash];
        }
    }
    

    Then you should upload this file to your server and include it between tags. This should do the trick.

提交回复
热议问题