Need help to construct my 301 redirection

Discussion in 'Apache' started by keny99, Dec 20, 2009.

  1. #1
    Hi,

    I need to change my website name, so to not loose my pages indexes in google i need to build 301 redirection.

    Can some one help me to build one for my website ?

    Here is what i want.

    http://website1.com to http://website2.com
    http://www.website1.com to http://www.website2.com

    http://website1.com/anypage.php?and=variable to http://website2.com/anypage.php?and=variable
    http://www.website1.com/anypage.php?and=variable to http://www.website2.com/anypage.php?and=variable

    Subdirectory to !
    http://anysub.website1.com to http://anysub.website2.com

    and

    http://anysub.website1.com/anypage.php?and=variable to http://anysub.website2.com/anypage.php?and=variable

    My website contains more that 1500 subdirectory

    So i want only to replace de domain name in any address.

    Is it possible something like

    RewriteRule (.*).website1.com/(.*) http://$1.website2.com/$2 [L,R=301]

    Thanks you very much
     
    Last edited: Dec 20, 2009
    keny99, Dec 20, 2009 IP
  2. takerraj

    takerraj Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi Keny99,
    Have you solved your problem? Is the above code you gave working? If you have met the above requirements, can you please tell me the code you used. Because I am in similar situation like you and want exactly what you want...
     
    takerraj, Jan 18, 2010 IP