redirecting a .asp page on a PHP server?

ddeems's picture

Ok - this is a bit of a corner that I worked myself into, and I'm hoping someone can HELP!!!!

I need to convert from ASP to PHP to use some software (aka Xtreme Conversions - long story). I'm ranked 9th for a fairly desirable keyword, so the idea of starting at zero and having 20 dead pages on my website is not very appealing.

ANYWAY, I'm using GoDaddy's hosting, and I couldn't find any controls for any kind of server side 301 redirect or any forwarding on a page level, and I tried using a php 301 redirect from an .asp page (on a test php site), and that didn't work.

Does anyone have any suggestions short of using a meta refresh to redirect the old .asp pages? The HTML part of the .asp page will load - if that's of any help.

Thanks,
Denise

redirecting a .asp page on a PHP server?

Jeremy Palmer's picture

I'm not sure it's technically possible to get your ASP code to execute on a PHP server.... unless you tell Apache to parse .aspx pages using the PHP scripting engine.

This would most likely have to be done by an Apache admin. I'm not sure GoDaddy allows this kind of customization.

Not sure if this code below will help you, but here it is for reference:

PHP redirect (note that the redirect must be called before you print anything out to the page - preferably towards the top of the script)

<?php
//you can use a relative URL like this:

header("Location:newpage.asp");

//or use an absolute URL like this:

header("Location:http://www.yoursite.com/newpage.asp");
?>

It's been a long time since I wrote ASP code, but let me see if I remember how to redirect using ASP

ASP example:

<%
'relative url example:
Response.Redirect("yourpage.aspx")

or

'absolute url example:
Response.Redirect("http://www.yoursite.comcom/yourpage.aspx")

%>

Syndicate content