0

i want to create an alias in my subdomain. The easiest way to do for my host is this :

Alias "/docs" "/var/sudomain/web"

Here all requests from http://google.io/docs will use folder /var/sudomain/web

but i want to do this

Alias "subdomain/docs" "/var/web"

Here all requests from http://subdomain.google.io/docs will use folder /var/sudomain/web

Can anyone help me?

Walden
  • 3
  • 2
  • Welcome to Server Fault! This question is being voted for closure because the author does not show a level of technical understanding or appropriate due diligence in researching the topic that the community judges as being a minimum barrier to participate. – Jenny D Apr 12 '17 at 15:36

1 Answers1

0

subdomain is part of the hostname, not part of the path.

The normal way to do this would be to have a separate <VirtualHost ...> block that has the hostname. That virtualhost would contain something like

ServerName subdomain.example.com
DocumentRoot /var/web/wherever
Alias "/docs" "/var/subdomain/web"

Otherwise, you might be able to use mod_rewrite to get part of the hostname into the path somehow.

DerfK
  • 19,493
  • 2
  • 38
  • 54