cancel
Showing results for 
Search instead for 
Did you mean: 

After configure apache virtual host all subpages became "404 not found"

Highlighted

After configure apache virtual host all subpages became "404 not found"

I have my Magento (2.3.3) installed with apache (2.4) and running on the following path:

 

 

/var/www/html/magento-prod

That is, to access my store the url is:

 

http://<my IP>/magento-prod/

To use my domain, I made the DNS appointment to my IP. Then, I configured the apache (2.4) virtual host:

 

<VirtualHost *:80>
        ServerAdmin email@exemple.com
        ServerName exemple.com
        ServerAlias www.exemple.com
        DocumentRoot /var/www/html/magento-prod/

        <Directory /var/www/html/magento-prod/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

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

But then, all pages became "404 - not found" and the layout gets messy:

 

Screen Shot 2020-05-14 at 23.05.34.png

 

If I comment the DocumentRoot /var/www/html/magento-prod/ code, the site return to normal.

 

Why is this happening?

 

Some other information:

 

- Apache rewrite is on

 

- I changed the apache2.conf file:

 

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride all
        Require all granted
</Directory>

- the ./htaccess file exists and the RewriteEngine is on