Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

301 redirects for windows to linux

  • 13-07-2010 08:48AM
    #1
    Registered Users, Registered Users 2 Posts: 597 ✭✭✭


    Hello,

    I have a website thats been changed from .net to php and Im going to create 301 redirects for the old pages to the new ones. For example, I want to redirect mysite.com/thispage.aspx to mysite.com/thatpage.php. Both have the same content.

    I'm trying to figure out how to do the redirects properly. My new server is a linux server and will not run .net(.aspx) pages so I guess I have to create the redirects in php. Bu tI am unsure if that would work becouase of the extension name change.

    Using the example above, Should I create a php page called thispage.php and use something like the script below to redirect to thatpage.php?

    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.nmysite.com/thatpage.php&quot; );
    ?>

    I don't have access to the php.ini or .htaccess files on the new server. Apologies if this is not clear.

    Thank you


Comments

  • Registered Users, Registered Users 2 Posts: 7,742 ✭✭✭mneylon


    Use Apache's mod_rewrite via a .htaccess

    That's what it's there for :)


  • Registered Users, Registered Users 2 Posts: 597 ✭✭✭yeraulone


    Thank you - works fine


Advertisement