lundi 12 février 2018

Configure apache2 to use multi-sites on one domain and on the same server . Ubuntu 16.04

I have a laravel web application and i want to create differents URLs for differents countries but with the same domain and on the same server. My URLs have to be like : www.example.com/fr/ or www.example.com/uk/. So i have create different directories for each countries and have use Alias in my /etc/apache2/sites-availabe/example.conf and this is it.

<VirtualHost *:80>

    ServerAdmin admin@example.com
    ServerName example.com
    serverAlias example.com
    DocumentRoot /var/www/example/
    Alias /fr    /var/www/example/example_fr/public
    Alias /uk    /var/www/example/example_uk/public

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


</VirtualHost>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire