Domain Pointer problem

jlab

New member
Joined
Feb 4, 2013
Messages
6
Hello all, I'm having problems with a domain pointer for example I have main account domain1.com and I need domain2.com to point to domain1.com. Also I need domain2.com to stay in the address bar while showing the content of domain1.com. I have followed most of the guides on here about domain pointing and I have set the domain pointer correctly according to the documentation I've read however the url still changes back to domain1.com no matter what I do and I need it to display domain2.com. Any help would be greatly appreciated. DirectAdmin is version 1.40.0 and its running on a CentOS 6.0 Final box, , please let me know if you need more information.
 
Try htaccess redirects such as mod_rewrite. If you setup the domain pointer as an alias it shouldnt be changing domains unless something in your site is doing the redirect.
 
@chatwizrd thank you for your quick reply, could you give me an example of a mod_rewrite rule that could work. I tried
Code:
RewriteEngine on
RewriteRule (.*) http://www.domain2.com/$1 [R=301,L]
I put that code in the .htaccess file of domain1.com but when I did that it gave me an Internal Error so I just commented out the line and the site became active again. Again I appreciate any help provided. Thanks
 
Thank you for the quick reply chatwizrd I tried posting a reply earlier so I'm sorry if this is posted twice but I tried
Code:
RewriteEngine on
RewriteRule (.*) http://www.domain2.com/$1 [R=301,L]
When I had that it kept the address in the bar but Firefox told me that is stuck in a loop and that it will never complete. I'm not sure if you have some examples I could look at or tell me what is wrong with the above code. Thanks again for all the help in advance.
 
I usually use something like this:

Code:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
rewriteEngine On
rewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]            
rewriteRule (.*) http://www.domain.com/$1 [R=301,L]          
</IfModule>

I think the reason yours loops is because you didnt put a condition to not do something if they are already on domain2.com
 
Ok so if I put
Code:
Options +FollowSymLinks
rewriteEngine On
rewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]            
rewriteRule (.*) http://www.domain.com/$1 [R=301,L]

then should I put
Code:
RewriteRule (.*) http://www.domain2.com/$1 [R=301,L]
under it so that way domain2 should redirect to domain1 ?
 
Just in case anyone stumbles upon this thread I solved my issue but it had nothing to do with the .htaccess file or DA it was a specialized config file on my webserver that was causing the issue. Thanks to chatwzrd for the help.
 
Back
Top