Forum Moderators: open

Message Too Old, No Replies

         

jiff

2:00 pm on Jun 7, 2005 (gmt 0)

10+ Year Member



Hi,

I hope someone can help with my dilemma, as I've been scratching my head all day.

Over the last 2 years my company has purchased several other companies and over the next month 3 will be merged onto a new server and domain Each has very good search engine listings so I am wanting to put 301 re-directs throughout each site which will direct to an appropriate page on the new site.

I would like to create a message on the new site that only appears when a visitor has been referred using one of the 301 re-directs, as an additional way of informing customers of the merge.

I have tried PHP scripts and JavaScript to find the referrer, but to no avail. I suppose my question is, is this possible?

Is there a way of finding the referring domain if it is from a 301 redirect?

Thanks for any assistance you can give!

Jiff

httpwebwitch

10:56 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try redirecting to the new domain with a wee querystring attached.

newdomain.com/default.php?from=overthere

then if your page detects "from", it can say "welcome y'all from over there."

Dijkgraaf

10:58 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<snip>deleted</snip>

httpwebwitch's suggestion would work :-)

jiff

8:04 am on Jun 8, 2005 (gmt 0)

10+ Year Member



Thanks httpWebWhich, unfortunately if I was to use a qurey string then this would not pass all the SE ranking over to the new pages which is very important to us!

httpwebwitch

1:51 pm on Jun 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I see your point.

So the path of redirection goes:
SE >(GET/click)> oldsite >(301)> newsite

What do you see when you put this on newsite:
<?php
echo $_SERVER["HTTP_REFERER"]?
?>

Do you see oldsite, or SE? or Nothing?

jiff

2:09 pm on Jun 8, 2005 (gmt 0)

10+ Year Member



The referrer is the search engine and not the old site.

This is the same response when I use JavaScript (document.referrer).

httpwebwitch

3:06 pm on Jun 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



damn. that's not going to be easy. But I guess if it was easy you would already have solved it. :)

well somewhere in that invisible step you need to add something that newsite can recognize. you have a few options:

GET (adds stuff to the querystring)
POST (has potential)
SESSION (probably will not cross domain boundaries)
COOKIE (not a good idea)

this problem sounds familiar [webmasterworld.com]...

jiff

3:41 pm on Jun 8, 2005 (gmt 0)

10+ Year Member



Thanks very much for your help, but I think I'm gonna have to come up with another idea.

I think "Birds" response on the other thread sealed it:

"Short answer: You can't." :)

cheers anyway

ltboy

7:08 pm on Jun 8, 2005 (gmt 0)

10+ Year Member



Actually, you can. Use a meta tag refresh instead of a HTTP redirect. This WILL cause some browsers, mostly text-based ones, to not redirect but will give you the proper %_SERVER['HTTP_REFERER'] value.
A simple page like the one below should work:

<doctype.....>
<html>
<head>
<title>This site has moved.</title>
<meta http-equiv="refresh" content="2;url=http://www.new_website.com/" />
<head>
<body>
<p>Such-and-Such Co Inc. has merged with This-Other Co. and can now be located on the web at <a href="http://www.new_website.com/">http://www.new_website.com/</a>.</p>
</body>
</html>

jiff

7:54 am on Jun 9, 2005 (gmt 0)

10+ Year Member



Hi ItBoy,

Using this re-direct will not transfer the page rankings over to the new page, as it is classed as a 302 re-direct.

Thanks anyway

Jiff

httpwebwitch

1:57 pm on Jun 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



likewise, any client-based redirection will not give you the 301 rank transfer you seek. The classic self-submitting form has the same deficiency:

<script>window.onLoad=function(){myform.Submit();}</script>
<form action="mypage.php"><input type="hidden" name="mypost" value="42"></form>

What would happen if you had all your oldsite 301 traffic go to a landing page on the new site, drop a session variable or cookie, then continue with a SECOND 301 redirect to the actual page?

SE >(get/click)> oldsite >(301)> newsitelandingpage >(set session, 301)> newsite

in more detail:
SE > click
oldsite.com/mypage.php > 301 to
newsite.com/landingpage.php?goto=mypage.php (set a session variable) > 301 to
newsite.com/mypage.php

I used that once as a rerouting and tracking module for PHPAdsNew, and it worked. But I was using a normal header() redirection, without the 301 error message. I'd like to see if it works for 301 redirection too.

try it and check each step using the server header tool [webmasterworld.com]

jiff

8:09 am on Jun 10, 2005 (gmt 0)

10+ Year Member



Thanks webwitch

I never thought of that, but would Google pass Page Rank twice? I can't imagine the full Page Rank would be passed to the end page, I'll need to find this out before setting it up.

httpwebwitch

3:45 pm on Jun 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



eek! FORGET about PageRank. If you're worried abuot the Little Green Stripe in your googlebar, stop it. It's the backlinks that matter most - your 301 redirection strategy is all about that.

AFAIK Google will not "pass PageRank" to your new page. The new page is not the same as the old page; it has to earn PR on its own merit. That will happen via all the backlinks being redirected in.

See the "problem" is that 301 redirection is supposed to be completely transparent. It shoves the user off to another page without any noise or compaint - and leaves no trace of its interference. That's normally a good thing...

I'm running out of ideas. this problem has intrigued me, I want to know the solution, if there is one

Receptional Andy

3:53 pm on Jun 10, 2005 (gmt 0)



Just a thought - the only way I can think of that you can tell a 301 has occurred is on the site doing the redirecting. So if you can contact that site from your new server, then it's theoretically possible to do what you ask:

Old site does a 301 and logs the visitor >> New site shows the page, checks the log on old site, and displays a message accordingly.

Not easy but could work unless I've forgotten something important ;)

encyclo

5:09 pm on Jun 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you absolutely have to have both the visible warning and the 301 redirect, then you should cloak the page to send the 301 to known bots and a page with a meta refresh to the rest. If you want to do it on the cheap then user agent-based cloaking would probably be enough for this - just parse the user agent string for "Googlebot", "Slurp" or "MSNBot".

However, personally I would do away with the warning completely and just use the 301 for everyone. Most users won't change their bookmarks even if you ask - they just want to see their content.

garann

6:10 pm on Jun 10, 2005 (gmt 0)

10+ Year Member



If you're not toally committed to PHP, JSP and ASP.NET should both provide a method that gives you the actual URL requested.

jiff

7:54 am on Jun 13, 2005 (gmt 0)

10+ Year Member



Thanks to everyone for your input:

httpwebwitch - I'm not too bothered about the actual PR, but Google does move the SE listings and page rank (not PR) to the new URL, which we are bothered about.

I think we're going to give up trying to track the 301, but instead we will use cookies to display a message to all new visitors for a couple of months.

Thanks again.

Jiff

g1smd

4:17 pm on Jun 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> newdomain.com/default.php?from=overthere

Nearly!

Try this:

newdomain.com/default.php#from=overthere

Kooo!

Google ignores the # and all of the stuff after it.

httpwebwitch

4:30 pm on Jun 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OMG that's brilliant. A good creative solution.

and - it works? I can 301 to "filename.php#1234" and Google still indexes "filename.php"?

We can easily chop the anchor (#) off the URL (by snooping in the $_SERVER collection) and use that to show a custom message... or anything.

jiff

8:10 am on Jun 14, 2005 (gmt 0)

10+ Year Member



Sounds like a great solution :)

But (why does there always have to be a but) has this method been tested, I'm beginning my own tests, so I'm just wondering if you have done any?

Thanks Jiff

g1smd

7:24 pm on Jun 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well I can tell you how Google indexes that page.

I added a page to a site last year. The only links to the page were pointing to /thepage.html#section1 and to /thepage.html#section2 and I did not realise that was the case for many months.

The page was indexed as thepage.html just a few days after going online. The page is still indexed, and still does not have any other incoming links (as far as I am aware) to it.