mardi 28 avril 2015

URL Rewriting and Laravel 4 Routes not working on server?

I bet this question has been asked time and time again, but I just can't seem to get an answer. Anyway, here is my situation. I have a domain, lets say works fine, everything works as it should. However, if I navigate to, which works on my local machine, I get a 404 error. However, if I go to, the about page works fine. I know this must be a mod rewrite issue. I have enabled mod rewrite and restarted my server to no avail. Anyway, here is some code:

Virtual Host:

<VirtualHost *:80>
  DocumentRoot "/var/www/example/public"
  <Directory "/var/www/example/public">
    AllowOverride all
    Allow from All

And here is my .htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews

    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]

I'm using Ubuntu 14.04 on a Digital Ocean Droplet.


Aucun commentaire:

Enregistrer un commentaire