开发者

Yahoo Webhosting 301 redirect without htaccess

Is there any other possible ways to redirect non-www domain to with www domain (from http://example.com to http://www.example.com). I signed up for yahoo ecommerce solution and i am using a custom template with store tags. Yahoo does not allow htaccess to be uploaded to their servers and informed me that it is not possible to do a redirect from non-www domain to www开发者_开发问答 domain, which is absurd.


If you manage DNS-zone for domain, you can try CNAME www to non-www IP (I can't be sure is useful results)


You have to create an "HTML redirect". This is a client-side redirection and tells the browser to request another page.

To create an HTML redirect page, you use the HTML meta tag, along with the 'http-equiv' and 'content' attributes.

To create an HTML redirect, place the following code between the document's head tags.

<meta http-equiv="Refresh" content="5; url=http://www.hostname.com/index.php">

In the above example, the page will redirect to the specified page in 5 seconds (as indicated in the 'content' attribute).

You can also use JavaScript to redirect to another web page


Will javascript do?

if (!/^www\./.test(document.domain)) {
  top.location.replace('www.' + document.domain);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜