ASP to PHP conversion

Discussion in 'PHP' started by mitchbuch, May 30, 2010.

  1. #1
    I am looking to convert one of my websites from ASP to PHP.

    The problem is this:
    I do not want to lose visitors who e.g. visit this URL, to one of my "pages":
    http://www.domain.com/dir/2/index.asp?tale=42

    Is it possible to have those pages in PHP as well. E.g. have it .asp instead of .php. I am probably very poor at describing the situation here, but hopefully you guys will understand :)
     
    mitchbuch, May 30, 2010 IP
  2. Adraco

    Adraco Active Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Yes, you can do that. Make up a new site and code it as PHP, then when ready, you setup redirects (Google 301 or 302 redirect) and that should take care of it for you.

    In short, yes, it can be done. But you will need to read up a bit on "redirects".
     
    Adraco, May 30, 2010 IP
  3. edpatton

    edpatton Active Member

    Messages:
    261
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    83
    Digital Goods:
    1
    #3
    Yea make up a new site in PHP and set up redirects as stated
     
    edpatton, May 30, 2010 IP
  4. mitchbuch

    mitchbuch Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    Thanks for your help guys :)
     
    mitchbuch, May 30, 2010 IP
  5. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #5
    I'm assuming this is a Windows server since you're using ASP currently.
    Do you know whether the HTTP server is IIS (Internet Information Services), Apache, or something else ?
    Does the current server have PHP available, and just not use it ?
    How busy is the site ?
    How many different ASP pages are there ?
    How old/established is the site ?

    It's technically possible to have files with an asp extension be parsed as PHP files. The back-end of the site could be switched over to PHP and to the users/search-engines/etc it wouldn't look like anything changed at all. The trick is to take one asp page at a time, reprogram it using PHP, then use something to rewrite requests to the asp files to a special temporary directory behind the scenes where asp is a registered PHP file extension. Once all of the reprogramming is finished, the temp directory is removed after moving all of the new files up one level.

    It could be a hassle, but if you want to avoid redirects and tracking down external links to get them changed, it might be worth at least looking in to for your site.
     
    joebert, May 30, 2010 IP
  6. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Just use Htaccess between domains
    And in the target script setup a Script such that it gets the URL and rewrites the asp to php and redirects the page :)
    It will help!
     
    roopajyothi, May 31, 2010 IP