Forum Moderators: phranque

Message Too Old, No Replies

display redirected homepage as mysite.com & meta?

display redirected homepage as mysite.com & meta?

         

finallygreen

5:14 pm on May 8, 2010 (gmt 0)

10+ Year Member



Hello,

Right now, I have an index.php file that reads like this:

<?php
header('location: http://www.example.com/my-redirect-location') ;
?>


So I'm wondering a few things:

1. is there a more appropriate way to do this?
2. is there a way to "hide" this redirect so it just reads mysite.com in the user's address bar?
3. is there a way to implement metadata from this index.php file that will hold true at the redirect target? (the site is a forum with dynamic metadata information, so the current metadata on the page I'm redirecting to is not particularly reflective of it being the site's homepage)

Thanks in advance for your help!

[edited by: jdMorgan at 1:16 pm (utc) on May 10, 2010]
[edit reason] example.com [/edit]

g1smd

5:55 pm on May 8, 2010 (gmt 0)

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



A redirect tells the browser to request a new URL.

There's no way to hide the new URL, because URLs are what are used on the web.


If the resource is within the same server you might be able to employ a rewrite.

With a rewrite the server would accept the same old URL request as before but would fetch content from some other internal location inside the server.

Currently your code returns a 302 redirect to the new URL.

true_INFP

11:25 pm on May 8, 2010 (gmt 0)

10+ Year Member



If you want Google (and possibly other SEs) to forget about the old URL and pass PR to the new URL, you should do a 301 redirect by adding the following line:

header("HTTP/1.0 301 Moved Permanently");

finallygreen

3:57 am on May 10, 2010 (gmt 0)

10+ Year Member



Thanks for the tip!