Adrian Neatu
Adrian Neatu

Reputation: 2039

make all subdomains access website root files

Here's what I want to do:

Let me know if you have any idea on how to do that, I guess it's a .htaccess thingy but I can't figure it out .

Upvotes: 1

Views: 1801

Answers (1)

LazyOne
LazyOne

Reputation: 165138

Use ServerAlias in your VistualHost configuration: set it up as single virtual host where all sub-domains point into the same root folder:

<VirtualHost *:80>
    ServerName mysite.com
    ServerAlias *.mysite.com
    DocumentRoot "\path\to\your\site\"
    ...
</VirtualHost>

This is the most recommended way -- no need to involve URL rewrite here.

Upvotes: 1

Related Questions