Forum Moderators: mack

Message Too Old, No Replies

Having both Index.html and Index.php

How to have a new site without deleting the old one

         

adder

4:45 pm on Dec 14, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi!
Although I have some experience, I've lost a clue on one peculiar problem.

I have an old site, which was written in php almost two years ago. Now having better php skills I've written a new and brilliant (that's what I think) script.
The old site is generally an index.php displaying different categories like:
index.php?cat=Category%20Name1
index.php?cat=Category%20Name2, etc.
This index.php file has a high Google PageRank and I don't want to lose it.

So the idea is to leave this old script and the index.php file as an archive and to have an index.html as a doorway to the new site, which will have separate files for each category and subcategory like keyword-phrase.php etc.

How do I best solve this?
Thanks

adwatson

5:41 pm on Dec 14, 2007 (gmt 0)

10+ Year Member



Can you simply rename index.php to index-old.php (or somesuch) so that index.html becomes the new homepage? Then you can just go to index-old.php to see the old site if needed.

jimbeetle

5:58 pm on Dec 14, 2007 (gmt 0)

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



If you replace the old content on index.php with new content, index.php will still keep its old PR. Is there some reason you don't want to do this?

jtara

6:29 pm on Dec 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, while you are reorganizing your site, reorganize it the right way.

You should never expose index files at all.

If your site is example.com, you should NOT be distributing links to example.com/index.php, example.com/index.html, or example.com/index.anything.

Links to your site should be to example.com.

Period.

A user who types-in example.com/index.html, or a misguided webmaster on another site that links to it should get either a 404 error or (better) a redirect to your home page in proper canonical form. (e.g. example.com).

Leave the old index.php, have it 301 redirect to example.com/, don't expose example.com/index.html to the world, and have new inbound links go to example.com/

Index files were never intended to be exposed in a URL using their file name. Yet I'd guess that 50% of web servers are mis-configured to do so.

adder

4:16 pm on Dec 15, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks for the answers,

adwatson, jimbeetle: I am reluctant because Google has indexed 130 different combinations of my index.php?cat=Whatever%20Category

My new index will not have those cat attributes anymore. Then in my Google Webmaster tool I will see a warning about 129 broken links next time I log in. That could kill my traffic. Google has been kind to me and I get approx 80% of traffic from it.

Unless I redirect them all. What kind of redirect is better?

jtara Yes, all my incoming links point directly to the domain not index.

Leave the old index.php, have it 301 redirect to example.com/

Maybe I better leave my index.php with all its cat attributes intact and install my new code under whatever-filename.php and redirect example.com/ to this whatever-filename.php?

Then Google will still be able to access my old index.php. I know I made a mistake two years ago but now I need to continue somehow without losing all my 130 indexed urls.

jimbeetle

5:39 pm on Dec 15, 2007 (gmt 0)

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



Unless I redirect them all. What kind of redirect is better?

Yes, a 301 redirect from the old to the new URLs is what you need.

ttyp

4:53 am on Jan 2, 2008 (gmt 0)

10+ Year Member



You can have index.html and index.php, depending on how your server is configured.

Usually, when a request comes in for example.com, servers search through specific file names and the first one that shows up is the file that's sent to the client.

So, you could have index.html, index.php, default.html, welcome.html all in the same root directory.

You can set up your server so a HTTP request to example.com would return the index.html file, while keeping the index.php live for the search engines and/or links from within index.html/other pages.

Contact your server admin.