0

I have my main domain address pointing to Squarespace.

I want to redirect a subdomain of that domain to my hosting folder. Right now the address of my folder in the hosting is like this: myserverIP/~hostingusername/website/

So what I want to achieve is this redirect:

www.domain.com --> mysite.squarespace.com
subdomain.domain.com --> myserverIP/~hostingusername/website/

Squarespace redirect works well but not the subdomain.

On the domain settings, I created an A record with the subdomain (subdomain.domain.com) pointing the myserverIP but since the site is not on the root IP but on a folder I don't know how to redirect to it.

Any ideas on how to achieve this?

1 Answer 1

1

You'd only need to create another VirtualHost in your apache(?) config file.

Something like this:

<VirtualHost *:80>
        ServerName subdomain.example.com
        DocumentRoot /home/subdomain/html

<Directory "/home/subdomain/html">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    Require all granted
</Directory>
</VirtualHost>

Then, you'd need another VirtualHost for your main site but I imagine you already have one as it's already up and running.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .