Andre Zimpel
Andre Zimpel

Reputation: 2343

.htaccess - Set Document Root based on Subdomain

I have multiple static sites, everyone of them has the same domain pattern:

projectname.staging.example.com

Currently, I have to add a new ghost every time I'm adding a new staging environment.

Is it possible to set the document root in the .htaccess file based on the subdomain (eg. projectname)?

Upvotes: 0

Views: 607

Answers (1)

Graham Dumpleton
Graham Dumpleton

Reputation: 58533

No. The .htaccess is only evaluated after any URL mapping to work out what directory is to be used.

I would suggest you look at mass virtual hosting options in:

Upvotes: 1

Related Questions