Forum Moderators: phranque

Message Too Old, No Replies

Old domain all files to new domain

Old domain all files to new domain

         

neoonprowl

9:18 am on Aug 27, 2007 (gmt 0)

10+ Year Member



I have just moved a domain and would like to know how to redirect everything from the old domain to the new domain.

With the following code it redirects all pages to the new domain

Code:

RewriteCond %{HTTP_HOST} ^.*oldwebsite\.com$ [NC]
RewriteRule ^(.*)$ [newwebsite.net...] [R=301,L]

so oldwebsite.com -> newwebsite.net

The problem is that oldwebsite.com/folder/file1.html is also -> newwebsite.net

What is the code for having oldwebsite.com/folder/file1.html automaticly redirecting to newwebsite.net/

jdMorgan

10:04 pm on Aug 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A popular question this month... This search [google.com] will turn up dozens of threads with the required code, often given as second step -- after the first step of mapping a subdomain to a subfolder (which you can disregard).

Jim