Mobile app version of vmapp.org
Login or Join
Vandalay111

: In apache, how to map site.example.com to example.com/site I'm sure there is documentation for how to do this, but I don't know what it's called so I don't even know how to start searching.

@Vandalay111

Posted in: #Apache #Subdomain

I'm sure there is documentation for how to do this, but I don't know what it's called so I don't even know how to start searching.

On my webserver, example.com, i have a site called site. It's accessed by going to example.com/site.

I want it instead to be site.example.com.

Can someone point me to apache documentation to enable this?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay111

2 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

I think you need to use virtual host. Edit the file called .../apache/conf/extra/httpd-vhosts.conf and add this line:

<VirtualHost *:80>
DocumentRoot "[PATH-TO-APACHE]/Apache2.2/htdocs/tema"
ServerName site.example.com
</VirtualHost>


Of course you need also to enable virtual hosts on apache editing the httpd.conf file.

10% popularity Vote Up Vote Down


 

@LarsenBagley505

Are you sure you want to rewrite or redirect people from the subfolder to a subdomain? Why not create a virtual host / subdomain then do 301 from the old subfolder to the subdomain?

This is a good tutorial on creating subdomains
thinkingnectar.com/2008/getting-ubuntu-to-work-creating-subdomain-in-localhost/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme