Welcome to WebmasterWorld Guest from 54.166.152.121

Message Too Old, No Replies

Migrate from PHP to ASP

     
10:51 am on Nov 14, 2008 (gmt 0)

10+ Year Member



I have an ecommerce site which is being moved from PHP to ASP (I know I know but that's the topic for another forum!)

The current URLs are simply page.php?ID=1234 or similar and so mapping across to ASP should be easy enough as such, but what is the best way to go about it?

Should I leave the PHP pages there, but doing a 301 redirect to the new ASP pages?

For dynamic sites will a 301 with a querystring work the same so page.php?ID=1234 can be 301'd to newpage.asp?ID=1234

Thanks!

[edited by: tedster at 7:54 pm (utc) on Nov. 14, 2008]

8:03 pm on Nov 14, 2008 (gmt 0)

10+ Year Member



That shouldn't be a problem. While you can do this at the Apache level I think I would prefer the PHP level because what if the pages aren't named the exact same thing?

Here is the code I would use on the PHP pages:


<?php
header("HTTP/1.1 301 Moved Permanently");
$query_append = '';
if ($_SERVER['QUERY_STRING'])
{
$query_append = '?'.$_SERVER['QUERY_STRING'];
}
header("Location: /newpage.asp{$query_append}");
?>
1:55 pm on Nov 17, 2008 (gmt 0)

10+ Year Member



Many thanks rankboy - that looks pretty straight forward.

Can I expect a bit of a tanking in the SERPS though do you think?

4:42 pm on Nov 17, 2008 (gmt 0)

10+ Year Member



If you don't want to setup redirects you could add this to your htaccess file:

AddType application/x-httpd-asp .php

This tells the server to parse .php files as asp

7:22 pm on Nov 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're switching to ASP I imagine your also going to IIS? I've never heard of someone running PHP under IIS. You could maybe have the PHP extension files run as ASP.

I've done a few site redesigns lately from asp to aspx. Besides changing the extension we also changed directory names. We noticed no drop in traffic and Google seemed quick to handle the changes.

If you have a strong site with good PR and trust I would just do a clean sweep, forget about the PHP files, and have a good 404 handler.

7:33 pm on Nov 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never heard of someone running PHP under IIS

I have done this a few times, actually works pretty well as long as you read up of performance issues. Off the top of my head you had to use FastCGI or it ran vvvv slowly!

9:04 am on Nov 18, 2008 (gmt 0)

10+ Year Member



Cheers guys - funnily enough the current PHP site already runs under IIS - we had to move the site a while back when our Linux box went bang and it never went back (because we knew this migration would happen one day)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month