Redirecting URL to a Sub-Server

Operating system: Centos
**OS version:**7

Guys, can someone direct me to the right source, please?.. I am trying to have a domain redirect to a sub-domain (server) and I can’t find any info on it. Thanks…

Probably the easiest way would be to alias the domain to a virtual server, and then redirect it in .htaccess in the root of the parent virtual server. Something along the lines of

RewriteEngine On
RewriteCond %{HTTP_HOST} redirecteddomain.com$ [NC]
RewriteRule ^(.*)$ https://sub.parentdomain.com/$1 [L,R=301]

Richard

Thank you. I’ll try that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.