Doman and subdomain

Hi

If I have directory “mysite” and you type www.mysite.com in browser URL you will get to index.html inside “mysite” directory. How would i set “someotherdir” to be accessed by typing “someotherdir.mysite” into URL

Thanks

What kind of hosting do you have? are you on a shared hosting platform? cloud? server? The option setup could be different depending on how your hosting environment is configured.

Most of the hosting providers i have had experience with have some kind of interface for allowing you to add subdomains and you can easily point those to a directory.

it would be on my home server (Apache)

I do not know your exact needs but you will need to setup virtual hosts in apache. I provided a example copied from another source.

NameVirtualHost 127.0.0.1:80
<VirtualHost *:80>
<Directory "C:\path\to\ecommerce">
    Options FollowSymLinks Indexes
    AllowOverride All
    Order deny,allow
    allow from All
</Directory>
ServerName ecomm.localhost
ServerAlias www.ecomm.localhost
DocumentRoot "C:\path\to\ecommerce"
</VirtualHost>
1 Like

Would I also have to have VH for “mysite” too?

From what i understand yes you would

1 Like

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