0
<VirtualHost :80>
    DocumentRoot "/study/data"
    ServerName example.com
    ServerAlias www.example.com
    <Directory "/study/data">
        Options Includes FollowSymLinks
        AllowOverride All Options FileInfo
        Order allow,deny
        Allow from all
    </Directory>

        Alias /science-rsch /study/data/www/science
        <Directory /study/data/www/science>
            Options Includes FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all

            RewriteEngine on        
            RewriteBase /science-rsch/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} !=/favicon.ico
        RewriteRule ^ index.php [L]
        </Directory>

        <Directory /study/data/www/science/sites/default/files>
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

Above works for www.example.com with the alias /science-rsch:

www.example.com/science-rsch -> /study/data/www/science

How to make the above virtual host ***also* work for a new ServerAlias(www.newdomain.com) with the Alias /content/science-rsch**:

www.newdomain.com/content/science-rsch -> /study/data/www/science

sunskin
  • 1,620
  • 3
  • 25
  • 49
  • Just add the serverAlias for that new domain and add the Alias for the url path the same way you did before `Alias /content/science-rsch /study/data/www/science`. What's the problem with this? You didn't try? – Daniel Ferradal Feb 08 '17 at 12:23
  • If I add this new alias /*content*/science-rsch for newdomain.com/content/science-rsch under the same virtualhost, wouldn't the original domain example.com/science-rsch also use the new alias instead of /science-rsch?? – sunskin Feb 09 '17 at 12:36
  • How do i make sure that different alias corresponds to different domains(ServerAlias)? – sunskin Feb 09 '17 at 12:38
  • 1
    If you want them to be separate domains with different behaviour then by all means all you must do is generate a new virtualhost for it. – Daniel Ferradal Feb 09 '17 at 12:55

0 Answers0