Do you see your homepage or all pages are as 404 ?
Have you configured your web server appropriately? If not so which one do you use Nginx or Apache
Getting the same issue here, everything was running fine, adding new routes as i progressed and now all of a sudden the new routes are not being run. Even putting the route right at the top of the routes file does not run. If you run a:
php artisan routes
the route exists.
woogygun said:
Getting the same issue here, everything was running fine, adding new routes as i progressed and now all of a sudden the new routes are not being run. Even putting the route right at the top of the routes file does not run. If you run a:
php artisan routes
the route exists.
Got it sorted with a
php composer.phar update
Both woogygun and guiden, think it's useful if you paste the relevant code so we can take a look at it. Use http://bin.laravel.io for that.
To me it sounds like a .htaccess-like problem, or the server not 'pointing' to /public, mod_rewrite not active.
Dayle has some examples for apache, nginx and lighttpd on his Github repo
1 Open httpd.conf
sudo vim /etc/httpd/conf/httpd.conf
2 Make sure the DocumentRoot is pointing to the laravel project's public directory 3 Add the Directory element for that path and Allowoverride All... as follows
DocumentRoot "/var/www/html/laravel/public/"
<Directory "/var/www/html/laravel/public">
Allowoverride All
</Directory>
4 Open .htaccess from ../laravel/public/ and make sure it has the following
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
5 Restart httpd services
sudo service httpd restart
6 Now http://DomainServer/users will work in your browser.
The thing with mine is that the '/' route is working but the others aren't ... why is that?
I just ran the command sudo a2enmod rewrite and restarted apache but still no good
same problem here, '/' route is working but the others not work ! why ?
claratan said:
same problem here, '/' route is working but the others not work ! why ?
Make sure your .htaccess file is copied into your documentroot directory.
I was following instruction by @pescadosmith my localhost is perfectly work when I am going to request URL or routes is not exist. the solved is to put add .000-default.conf
<VirtualHost *:80>
ServerName www.van-vlymen.com
ServerAlias van-vlymen.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/vanvlymen/public
<Directory /var/www/html/vanvlymen/public>
Allowoverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
inside the etc/apache2/000-default.conf.
it seems working now thanks you so much for added this!
pescadosmith said:
Apache Web on Linux
My answer on stackoverflow: http://stackoverflow.com/a/24354757/2517465
1 Open httpd.conf
sudo vim /etc/httpd/conf/httpd.conf
2 Make sure the DocumentRoot is pointing to the laravel project's public directory 3 Add the Directory element for that path and Allowoverride All... as follows
DocumentRoot "/var/www/html/laravel/public/" <Directory "/var/www/html/laravel/public"> Allowoverride All </Directory>
4 Open .htaccess from ../laravel/public/ and make sure it has the following
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
5 Restart httpd services
sudo service httpd restart
6 Now http://DomainServer/users will work in your browser.
This worked for me!
pescadosmith said:
Apache Web on Linux
My answer on stackoverflow: http://stackoverflow.com/a/24354757/2517465
1 Open httpd.conf
sudo vim /etc/httpd/conf/httpd.conf
2 Make sure the DocumentRoot is pointing to the laravel project's public directory 3 Add the Directory element for that path and Allowoverride All... as follows
DocumentRoot "/var/www/html/laravel/public/" <Directory "/var/www/html/laravel/public"> Allowoverride All </Directory>
4 Open .htaccess from ../laravel/public/ and make sure it has the following
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
5 Restart httpd services
sudo service httpd restart
6 Now http://DomainServer/users will work in your browser.
Thanks! This worked for me too.
Enable mod_rewrite
sudo a2enmod rewrite
sudo service apache2 restart
everything else are not working till i do the enable mod_rewrite
sudo a2enmod rewrite
sudo service apache2 restart
finally thank you
johnathansantos said:
Enable mod_rewrite
sudo a2enmod rewrite sudo service apache2 restart
This! solved it for me on a clean install box.
Thanks!
Perfect! This worked for me as well. Thank you!
pescadosmith said:
Apache Web on Linux
My answer on stackoverflow: http://stackoverflow.com/a/24354757/2517465
1 Open httpd.conf
sudo vim /etc/httpd/conf/httpd.conf
2 Make sure the DocumentRoot is pointing to the laravel project's public directory 3 Add the Directory element for that path and Allowoverride All... as follows
DocumentRoot "/var/www/html/laravel/public/" <Directory "/var/www/html/laravel/public"> Allowoverride All </Directory>
4 Open .htaccess from ../laravel/public/ and make sure it has the following
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
5 Restart httpd services
sudo service httpd restart
6 Now http://DomainServer/users will work in your browser.
johnathansantos said:
Enable mod_rewrite
sudo a2enmod rewrite sudo service apache2 restart
much love
My routes were working for months and then suddenly I started getting 404 for every route, except the root one
<Directory "/var/www/html/laravel/public">
Allowoverride All
</Directory>
Adding this to apache2.conf solved the problem for me
ironheartbj18 said:
everything else are not working till i do the enable mod_rewrite
sudo a2enmod rewrite sudo service apache2 restart
finally thank you
This work for me too
did you get this sorted out?
also php mcrypt is required for laravel to work correctly.
if you are using homestead for local development then all that is taken care of.
I also think you should be using Nginx. https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-considerations
in my opinion, its way easier to setup and i remember having a lot less problems with it. apache has its strengths, but for the things i currently do i dont see any benefits.
johnathansantos said:
Enable mod_rewrite
sudo a2enmod rewrite sudo service apache2 restart
Spot on! Thanks!
2 second check before doing the above, make sure you run
as this rebuilds the static file
johnathansantos said:
Enable mod_rewrite
sudo a2enmod rewrite
I too just needed to enable mod rewrite. Thanks!
pescadosmith said:
Apache Web on Linux
My answer on stackoverflow: http://stackoverflow.com/a/24354757/2517465
4 Open .htaccess from ../laravel/public/ and make sure it has the following
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
5 Restart httpd services
sudo service httpd restart
6 Now http://DomainServer/users will work in your browser.>pescadosmith said:
Apache Web on Linux
My answer on stackoverflow: http://stackoverflow.com/a/24354757/2517465
1 Open httpd.conf
sudo vim /etc/httpd/conf/httpd.conf
2 Make sure the DocumentRoot is pointing to the laravel project's public directory 3 Add the Directory element for that path and Allowoverride All... as follows
DocumentRoot "/var/www/html/laravel/public/" <Directory "/var/www/html/laravel/public"> Allowoverride All </Directory>
4 Open .htaccess from ../laravel/public/ and make sure it has the following
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
And worked for me , thanks
johnathansantos said:
Enable mod_rewrite
sudo a2enmod rewrite sudo service apache2 restart
This saves my day. Thanks @johnathansantos
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community