Code for requested url link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fredski
Forum Newbie
Posts: 7
Joined: Tue Sep 13, 2005 10:15 am

Code for requested url link

Post by fredski »

Im trying to work out some code to put into the footers of my pages that will link to my old domain page that has a 301 redirect on it to help the search engines know that the old domain page has been permanently changed.

Code: Select all

<a href="http://www.my-old-domian.com<?=$_SERVER['REQUEST_URI']?>">my old domain</a>
This is the code I'm working on but as yet it dosn't work.

The page structure is the same the only difference is that the pages now have a different domain name. Im concentrating on getting links to the new domain, but need google to recognise that the old domain page has now been replaced by the new one.

I've also as an added precaution added a full sitemap to google for the old domain that is set up with a 301 redirect.

Can anyone help me with the link code?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

are you sure short tags are on?
Post Reply