: 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.
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?
More posts by @Vandalay111
2 Comments
Sorted by latest first Latest Oldest Best
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.
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/
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.