How to point at all subdomains by another domain

ajax20

Verified User
Joined
Jul 16, 2014
Messages
142
Hello

I have used another domain name to point to my main domain. Say, if my main domain is example.com, then I have used example.org to point to the former. Now, what I am seeking is for all subfolders of of my main domain to be also pointed at by the other domain. I mean, for instance, if I have

Code:
example.com/about
example.com/contact
.
.
.
be pointed at with

Code:
example.org/about
example.org/contact
.
.
.

Is that possible in DA?

Any ideas would be highly appreciated.

Regards
 
Last edited:
Hello,

If you use a directadmin built-in function domain alias then virtual hosts should behave the way you describe.
Or give mod_rewrite a try.
 
Hello,

If you use a directadmin built-in function domain alias then virtual hosts should behave the way you describe.
Or give mod_rewrite a try.

Hello Alex

Thanks for replying. Can you explain more about the mod_rewrite method?

Thanks
 
No, thanks.

Please use Google to find ready made examples of mod_rewrite rules in order to redirect requests from one domain to another.
 
Hello

This thread was posted quite a while ago. But I am still struggling with this problem. (Actually, for sometime, I decided not to have the second domain at all.)

Based on the advice given, I added the following to my htaccess with a hypothetical primary domain name:

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

Also, I think I have wrongly used the term subdomain in the original post. It was better to call "/contact/, for instance in "example.org/contact/ as "subfolder or "subdirectory".

Anyways, can anyone help me find the right solution?

Regards.
 
Unless I'm missing something, an alias "Domain Pointer" will do that for you.. no need for rewrites or custom changes.
User Level -> example.com -> Domain Pointers -> Add Pointer: example.org

Subdomains should be included as part of the pointer setup... DA should add the A records to the zone too.

John
 
Back
Top