Skip to main content
Topic: Routing Error 404 Page (Read 981 times) previous topic - next topic

Routing Error 404 Page

Good day team,

Has anyone experienced issues with  page routing after deploying project to Ubuntu Apache2 host server. After logging in ,after the index page...I am getting 404 errors all pages. But XAMPP is running fine.

I have setup ssl encryption for the site but that shouldn't affect routing.

I have also enabled mod_rewrite on the Apache Server.

Apache.conf directory settings:

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

Application .htaccess file:
RewriteEngine on
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?request_uri=$1 [NC,L,QSA,B]

App Virtualhost config:

<VirtualHost *:80>
     ServerAdmin admin@app
     DocumentRoot /var/www/html/app
     ServerName app

     <Directory /var/www/html/app/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
     </Directory>

     <FilesMatch \.php$>
        # 2.4.10+ can proxy to unix socket
         SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
     </FilesMatch>

     ErrorLog ${APACHE_LOG_DIR}/app_error.log
     CustomLog ${APACHE_LOG_DIR}/app_access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =app
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>