site is pure html and planning to migrate it to php. what is the best way to implement without losing any traffic and following google's rules? Should I use a 301 redirection? Do I have to delete the old html files? Nice forum! Very informatve.
Dont delete the html. The html is still going to be indexed in the search engines. So what you want to do is to 301 from the html to the php. Once you php pages are indexed then you can get rid of the html.
will this not considered a duplicate content? are there any other way aside from doing a permanent redirection?
Leave the file extensions as .html and tell your server to process .html as php. This is talked about in this thread: http://forums.digitalpoint.com/showthread.php?p=186832 If you are using apache you can do this by using a .htaccess file with the following: AddHandler application/x-httpd-php .htm AddHandler application/x-httpd-php .html Most (but not all) control panels will allow you to do this through them. This way the search engines don't know the difference and no duplicate content.
If i can bring up this old thread. I need to do the same thing, I have some html pages that need to be changed to .php so I can use PHP include files (i assume i cant include the files in .html?) Is the way LGRComp said the best way, or a 301 redirect?
Neither way is 'best'. Just a different set of goals and tradeoffs. I have used both methods at various times. Another method I use sometimes is to combine them. Hard link the html to php and set up the server to serve both... then a few years later all the html is set to do the redirects.
A few years? lol I dont even know how to do 301's, so Im just working out whats best before I jump in and stuff everything up...
Yep, usualy try and use cool urls. ( http://www.w3.org/Provider/Style/URI ) It really takes awhile for urls to 'go away' , I still gets hits on things that have not been updated in almost a decade.
By doing what he was saying, you don't need to do a redirect. You just keep the site with the same extensions, but the html pages are treated exactly like php pages. As far as ranking goes, if you dont need to have a php extension, I would personally keep the extensions the way they are. Otherwise here is a php redirect script: <?PHP header("HTTP/1.1 301 Moved Permanently"); header ("Location: http://www.mysite.com/this-new-page.php"); exit (); ?> Code (markup): Also, if you are keeping the same page names, but just changing the extension type then you can use an htaccess script to redirect each page to the new page.