VirtualHost with wildcard VirtualDocumentRoot

后端 未结 2 571
余生分开走
余生分开走 2020-12-23 18:23

I\'m trying to create a fallback for my virtual hosts. My configuration looks like this:

# Fetch all pre-defined hosts
         


        
2条回答
  •  庸人自扰
    2020-12-23 18:27

    I use them :) You forgot about switching off canonical names - unfortunately I don't know why there must be ServerAlias in my configuration - it just won't work without it - code below is tested and working

    
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
        Require local
    
    
    
        # Apache will form URLs using the hostname supplied by the client
        UseCanonicalName Off
    
        # available aliases to use
        ServerAlias *.lab *.lab2
    
        # where to put them
        VirtualDocumentRoot "C:/LocalServer/%2/%1/public/"
    
    

提交回复
热议问题