Forum Moderators: phranque

Message Too Old, No Replies

HTTP 301 Redirect alternatives

when you don't have acces to the server,

         

The_Hat

3:13 am on Aug 22, 2004 (gmt 0)

10+ Year Member



Friend of mine has a site that was set up on the server of a previous employer as a sub domain (i.e. www.example.com/~his stuff)

I got him all interested in adsence and making some coin with his little niche site. And in the process convinced him to also host with me as well...

Well the folks that were hosting previously hosting were rather unhappy that he didn't host with them instead and so won't set up a correct 301 at the server level.

So far he dose have a bit of javascript code that throws a proper 301 header and redirects to the new location. But he only has it on the home page of the old location. (all other pages still exist, un-altered in the old location) Should I have him use this same java on all the pages that are in the location?

The old location has many links from other sites pointing to it and so carries a good deal of page rank that he dose not want to lose.

What is your best advice?
Thanks in advance.
The Hat,

The_Hat

8:22 pm on Aug 22, 2004 (gmt 0)

10+ Year Member



Anyone? Anyone?

mcavic

8:44 pm on Aug 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah, if the javascript code works, then I'd use that on each page.

But I didn't think it was possible to do a 301 from javascript. You can go here [webmasterworld.com] to make sure it's really giving the right header.

The_Hat

9:25 pm on Aug 22, 2004 (gmt 0)

10+ Year Member



Yup, it throws a "HTTP/1.1 301 Moved Permanently"
maybe it isn't really javascript, the code used is something like.

<title>example</title>
<script language="JavaScript">
<!--function SymError()
{return true;}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{return (new Object());}
window.open = SymWinOpen;
//-->