I have a domain name I am no longer using, but would like to redirect all traffic from that site to a specific page on my main site.
For example, if a user visits: www.oldsite.com
They would be redirected to: www.mainsite.com/page.htm
So far, I have URL forwarding setup on the domain name that sends requests to my main domain. Then I have the following in my htaccess file to send them to the specific page:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.oldsite.com$ [NC]
RewriteRule ^(.*) /page.htm [R=301,L]
This works great for the old domain name, but if the visitor tries to access one of the pages I used to have on the old site, it redirects to something like this:
www.mainsite.com/oldpage.htm/page.htm
How can I strip out everything but the old domain name (for that domain only) before redirecting to the new page.htm? I don't care about any of the old pages, I want everything from that domain directed to the new page.