redirect 301 query

Discussion in 'Programming' started by amiman, Jan 4, 2010.

  1. #1
    I am rebuilding a site using Joomla, by doing this my pages are changing url .
    The existing site has a mix of .php .htm .html the new site will be whatever Joomla makes them. Alot of my internal pages have good PR and have read if I 301 them the new pages will get their PR.
    I am wanting to redirect using 301 and want to know how to do it.

    If I put


    in htaccess will this work?? and have I wrote it right?
    Also where in htaccess do I put it?? at the begining or at the end ??

    Thanks in advance for your help.

    .
     
    amiman, Jan 4, 2010 IP
  2. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Read following tutorial.

    htaccess 301 Redirect Tutorial

    There is an easy way to do this without using .htaccess.

    In oldpage.htm, you write the following code.
    
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.mysite.com/newpage.htm" );
    ?> 
    
    PHP:
    You may read this tutorial for ColdFusion, ASM, etc.. methods.
     
    NeoCambell, Jan 4, 2010 IP
  3. Mail Propeller

    Mail Propeller Peon

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.mysite.com/newpage.htm" );
    die();
    ?> 
    
    PHP:
    otherwise the page will keep going
     
    Mail Propeller, Jan 7, 2010 IP