Redirect domain2.com to domain1.com/pagename.php
2 posts
• Page 1 of 1
Redirect domain2.com to domain1.com/pagename.php
Hello all,
I am having a real issue and hope someone can guide me!
Using Helicon Ape on Win2k8 R2 IIS7.5
We have a main domain website (domain1.com) and also have a second domain (domain2.com) as an alias, however what we would like to do is redirect domain2.com to a page on domain1.com, so:
http://www.domain2.com redirect to http://www.domain1.com/pagename.php
We have tried a number of redirects but nothing seems to work! If we enter domain2.com it simply goes to domain1.com.
We are currently trying:
Just to add to this, there is the following already in the htaccess file for the main domain1.com which we do not want to change if we can help it:
Any guidance would be very much appreciated!
I am having a real issue and hope someone can guide me!
Using Helicon Ape on Win2k8 R2 IIS7.5
We have a main domain website (domain1.com) and also have a second domain (domain2.com) as an alias, however what we would like to do is redirect domain2.com to a page on domain1.com, so:
http://www.domain2.com redirect to http://www.domain1.com/pagename.php
We have tried a number of redirects but nothing seems to work! If we enter domain2.com it simply goes to domain1.com.
We are currently trying:
- Code: Select all
RewriteCond %{HTTP_HOST} ^domain2.com$
RewriteRule ^$ http://www.domain1.com/pagename.php [L,R=301]
Just to add to this, there is the following already in the htaccess file for the main domain1.com which we do not want to change if we can help it:
- Code: Select all
Options +FollowSymlinks
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http://www.%1%2 [R=301,L]
Any guidance would be very much appreciated!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Redirect domain2.com to domain1.com/pagename.php
Hello,
I'd try using:
and put it ABOVE the rule that you already have. The first rule seems to be a more generic and catches your request before anything else.
Regards
I'd try using:
- Code: Select all
RewriteCond %{HTTP:Host} ^domain2\.com$ [NC]
RewriteRule ^/?$ http://www.domain1.com/pagename.php [NC,R=301,L]
and put it ABOVE the rule that you already have. The first rule seems to be a more generic and catches your request before anything else.
Regards
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests