Answer the question
In order to leave comments, you need to log in
Apache: how to make subdomains like folders?
There is a site.com domain. How can I make all *.site.com requests work as site.com/* (where "*" is any subdomain. for example: blog, about, account ...) ?
Tried like this:
<VirtualHost *:80>
ServerAlias *.site.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^((.*)\.)site.com$
RewriteRule ^/(.*) /%2/$1
DocumentRoot /home/site.com/www
<Directory /home/site.com/www>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question