Forum Moderators: phranque
I don't really spend much time with Apache at all, so I really don't know what I am doing (as I am sure you will see):
The following is only redirecting (http://www.newdomain.com) to (http://www.maindomain.com) - not to the specific page. Any help would be much appreciated.
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.newdomain\.com)?$
RewriteRule ^/$ [maindomain.com...] [R=301,L]
Thanks,
EDITED:
If you would like it to be IS newdomain.com, simply remove the ! from what you have and change it to:
((www)?\.newdomain\.com)
The preceding will make the www optional.
The following should redirect everything:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www\.maindomain\.com)?$
RewriteRule .? http://www.maindomain.com/specificpage.html [R=301,L]
.? on the left side says any character 0 or 1 time, so it 'implicitly' matches everything, because it's an un-anchored pattern.