Resolve local subdomain on apache for paths within user dir
        Posted  
        
            by 
                MaoPU
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by MaoPU
        
        
        
        Published on 2010-09-07T22:47:16Z
        Indexed on 
            2011/01/02
            19:55 UTC
        
        
        Read the original article
        Hit count: 251
        
On Apache 2.2.x I've activated mod_userdir. I used the default setup, so that http://localhost/~name/ will be connect with ~name/public_html/ and a path within public_html, e.g. ~name/public_html/mySite can be reached through http://localhost/~name/mySite.
How can I achieve, that the same path can be reached through http://mySite.name.localhost/? I don't want a manual approach like it is suggested in other SF questions (such as http://serverfault.com/q/133921/53624), but rather want an automatic mapping of all available paths to the corresponding URL.
I think, several steps will need to be taken: Change mod_userdir configuration, so that the subdomain of localhost will be connected with all available user names on the machine. The second step would maybe include the usage of mod_rewrite, so that the subsubdomain could be matched to the path within ~name/public_html...
What would be your prefered way?
© Server Fault or respective owner