Mobile app version of vmapp.org
Login or Join
Megan663

: I want to redirect subdomain.domain1.com to domain2.com/directory using DNS I own 2 domain names "domain1.com" and "domain2.com", I want to redirect subdomain.domain1.com to domain2.com/directory using

@Megan663

Posted in: #Dns

I own 2 domain names "domain1.com" and "domain2.com", I want to redirect subdomain.domain1.com to domain2.com/directory using DNS (preferably). Can anyone assist (I am an amateur at domain management)?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Megan663

2 Comments

Sorted by latest first Latest Oldest Best

 

@Speyer207

Some premium dns providers provide extra features at dns level such as Dyn do.

Quote on Dyn's Webhop service


Redirecting a Subdomain to a Subdirectory

EXAMPLE

myhost.dyndns.org/
redirects to
myserver.dyndns.org/~myhomepage/
In many instances, you may wish to redirect from a subdomain (e.g.
subdom.domain.com) to a subdirectory of your main site (e.g.
domain.com/subdir). While creating a WebHop redirect is a simple
enough solution, a better solution is to use either virtual hosting or
a 301 server-side redirection instead..


While the quote isn't a 100% match it should in theory and gives you an idea that 'somethings' can be done at dns level, however they do advise that this should ideally be done at hosting level, if you do consider this a viable solution ensure you question them beforehand as I do not have firsthand experience but have heard of others doing it a similar way.

10% popularity Vote Up Vote Down


 

@Kevin317

You can use a simple redirect pointing subdomain.domain1.com to domain2.com/directory.

In order to do this open your public_html folder.
You will see a .htaccess file present under the public_html folder.

Add this code in the .htaccess file:

RewriteCond %{HTTP_HOST} ^subdomain.domain.com
RewriteRule ^(.*)$ domain.com/subfolder/ [R=301]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme