Welcome to WebmasterWorld Guest from

Message Too Old, No Replies

Proper 301 redirect implementation from old site-->new site

9:13 pm on Jul 29, 2006 (gmt 0)

10+ Year Member

Hi there I am finishing up a new site and I have some questions regarding how to properly replace the old site without blitzing myself in google:

1. The index page of the old site is index.htm, the new site is index.php. I was told by tech support at my hosting company that they can switch index.php to be the index page on the server at any point. The great majority of my links link to www.mydomain.com. Will switching index pages cause me to lose the PR from these links?

2. I have several links coming into html pages and I want to use 301 redirects from the old pages to the new ones. The new pages are dynamic pages but use URL rewrite module to make them "pretty". The new pages don't end in .html though. Will the pagerank/links still be passed on even though the pages have different names?

9:27 pm on Jul 31, 2006 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

The point to be clear about is that Google indexes urls, not "pages". So these are ALL different urls:


If inbound links point to the domain root www.example.com, then changing the technology used to generate that content will make no difference (I am assuming that the address in the location bar stays the same and does not add on the index.html for some reason.) To the degree that links point to www.example.com/index.htm (even links within your domain) you will probably see a dip.

It is possible to configure a server to parse the htm extension as php. This may be the very best solution in your case, especially since Google's handing of 301 redirects still does not seem to be consistent. There's lots of discussion about this in our PHP Forum -- here's one thread:

Parsing PHP with HTML file extension [webmasterworld.com]

9:38 pm on Jul 31, 2006 (gmt 0)

10+ Year Member

Thanks Tedster, you always seem to know the answers! The new php site in fact will append the index.php to the end: www.mysite.com/index.php, whereas my current site doesn't. I don't have any links pointing internally or externally to index.htm now. So basically I can replace the site and still retain the external links into my domain? For any links to internal pages should I use a 301 redirect? The page names have all changed. Thanks
11:45 pm on Jul 31, 2006 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

I have long advised that when you link to an index page, never include the index file filename itself in the link. Now you know why. Link only to the domain or to the domain and folder. Get rid of the filename in all the links.

Do you ever go to www.google.com/index.html to search?

1:23 am on Aug 1, 2006 (gmt 0)

5+ Year Member

To take it one step further, now that you are switching and redirecting, why not do it without file extensions – meaning set up new site such that it doesn’t show file extensions, and redirect from www.examle.com/page1.html to www.example.com/page1. This way if you ever find yourself wanting/needing to switch technologies (from php to html, or to whatever else) your URLs don’t change.

As already pointed out, link to home page without index.html (i.e just www.example.com/)


1:29 am on Aug 1, 2006 (gmt 0)

10+ Year Member

All of my links are coming into www.mysite.com, not to mysite.com/index.html...that's a good thing. The new php site is dynamic, but does allow "pretty URLS" so they are rewritten as Tastatura says to www.example.com/page1, with no file extension at the end.
6:23 pm on Aug 2, 2006 (gmt 0)

10+ Year Member

Hi ichthyous,

You've already gotten a lot of good advice here, and I'm glad you're not internally linking to /index.htm.

But just in case... if I were you, I'd 301 your old index page to the php version. And definitely add index.php to the front of your DirectoryIndex line in your .htaccess file (or have your hosting provider do this for you).

301'ing your other pages makes sense, too. Prettified dynamic pages should be okay, as long as you keep things consistent and page pointers unique ( e.g., don't use more than one "pretty" URL to refer to the same content).

Yes, PageRank should be passed via the 301s, but it's not going to be instantaneous. Be patient :)

8:27 pm on Aug 2, 2006 (gmt 0)

5+ Year Member

Sorry for the confusion (in my ThatAdamGuy post above); I was accidentally signed in on my old account.
12:44 am on Aug 3, 2006 (gmt 0)

5+ Year Member

Is there any difference in writing internal links as

www.mysite.com/ vs www.mysite.com


1:22 am on Aug 3, 2006 (gmt 0)

10+ Year Member

Thanks for the advice everyone, it's been very helpful!
5:58 am on Aug 3, 2006 (gmt 0)

5+ Year Member

Well, in lieu of an answer to the question above, I'm going to follow webmasterworld's example and drop the trailing /.
8:48 pm on Aug 3, 2006 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Some servers issue a 301 redirect from www.domain.com to www.domain.com/ so include the / in all your internal links.

Featured Threads

Hot Threads This Week

Hot Threads This Month