How to redirect domain and its interanl pages to the new domain?

Discussion in 'Apache' started by John_David, Nov 30, 2009.

  1. #1
    Hi folks,

    I am planning to move my old website to a new website. My old website is a .com and the new website is .net. The prblem i am having that my .com has more then 150 pages which i need ot redirect on the similar page of my new .net domain. How can i redirect them and what shoudld be the code.

    Please help.

    Thanks
     
    John_David, Nov 30, 2009 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(.*)olddomain.com [NC]
    RewriteRule ^(.*)$ http://newdomain.net/$1 [R=301,L]
     
    Bohra, Nov 30, 2009 IP