AnchovyLegend AnchovyLegend - 2 years ago 51
PHP Question

All routes causing 404

We are trying to go live with our Laravel project on an Ubuntu server running Apache. While all routes and functionality works locally, after going live, all routes that are not the home route result in a 404 error.

I am using the default laravel .htaccess in the /public directory.


looks as follows:

<VirtualHost *:80>

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all

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

root directory does not currently contain any .htaccess.

I enabled modrewrite using
a2enmod rewrite
and restarted apache after every change.

Has anyone else run into this issue? I appreciate any suggestions on how to resolve.

Thanks in advance!

Answer Source

You write in every rows. But later you talk about folder. (Note the A). Is it just a mistyping?

Update: The problem is an other mistyping: directories should be the same on the following lines:

    DocumentRoot /var/www/html/
    <Directory /var/www/html/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download