1

When I go to www.example.fr I get the correct DocumentRoot(/var/www/example/web), but when I try to go to example.fr, it gives me the default DocumentRoot(/var/www/).

I tried a lot of things already but nothing worked.

/etc/hosts : 
51.254.122.31   example.fr


/etc/apache2/sites-enabled/example.fr.conf :

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName example.fr
        ServerAlias www.example.fr
        DocumentRoot /var/www/example/web/
        DirectoryIndex app.php
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Any idea what I did wrong ?

1 Answer 1

2

You probably forgot NameVirtualHost directive. You can also check configured virtual hosts with apachectl -S.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .