Domain Migration & URL Rewriting

Discussion in 'Apache' started by faisal313pk, Dec 16, 2009.

  1. #1
    Hello everyone,

    I have a situation where I am migrating from my old domain to new domain like

    myolddomain.com to mynewdomain.com

    We are gonna putting same content just domain name change. Can anybody help me regarding URL Rewriting via .htaccess?

    I know there is single page by page redirection and at domain level redirection. But is there anyway, in URL Rewriting rule that every page of olddomain.com will automatically redirected to mynewdomain.com as they have same URL structure just domain name is changed. I think there may be some wildcard redirection in .htaccess...

    I will be more than thankful to you...
     
    faisal313pk, Dec 16, 2009 IP
  2. iama_gamer

    iama_gamer Active Member

    Messages:
    404
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    1) your domain registrar may be able to forward your domain

    2) control panels like cpanel have this option

    3) .htaccess


    RewriteCond %{HTTP_HOST} ^myolddomain.com$
    RewriteRule ^(.*)$ "http\:\/\/mynewdomain.com\.info\/$1" [R=301,L]
     
    iama_gamer, Dec 17, 2009 IP