0

On every page besides / I get a 404 page, and not laravel's 404 page?

404

I have enabled mod_rewrite.

Here is my .htaccess:

<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 my /etc/apache2/siotes-enabled/000-default.conf:

<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    <Directory "/var/www/html">
        AllowOverride All
    </directory>
</VirtualHost

If I go to joshharington.com/index.php/about it works, but if I just go to joshharington.com/about it doesnt so I have gathered that it is a .htaccess problem.

I don't know much about .htaccess, but this works on my localhost. What am I doing wrong?

Haring10
  • 1,498
  • 1
  • 18
  • 35
  • 1
    Is [`mod_rewrite` enabled](http://stackoverflow.com/q/869092/1903366)? – lukasgeiter Feb 05 '15 at 07:38
  • As stated in the post, under the first picture, `I have enabled mod_rewrite` – Haring10 Feb 05 '15 at 08:24
  • Oh. Sorry missed that one... – lukasgeiter Feb 05 '15 at 08:25
  • Have you renamed Laravels `public` directory to `html`? If not I think your DocumentRoot should be `/var/www/html/public` – lukasgeiter Feb 05 '15 at 08:28
  • @lukasgeiter No, I am not using `public`, the files are set so that `html` is the `public` folder. From this tutorial http://tutsnare.com/remove-public-from-url-laravel/ – Haring10 Feb 05 '15 at 08:41
  • Okay I see. This is slightly unrelated to the question, but why didn't you just change the DocumentRoot to `/var/www/html/public` instead of moving things and changing paths? – lukasgeiter Feb 05 '15 at 08:49
  • Because taking `public` out of the url is harder than this method. This method just works. – Haring10 Feb 05 '15 at 09:08
  • Well not really. If your DocumentRoot points at `public` it's not in the URL anymore. And apparently there's something not working with this method... – lukasgeiter Feb 05 '15 at 09:13
  • No, it works in localhost and on other projects just fine, but now with this specific one it does not work. – Haring10 Feb 05 '15 at 09:19

0 Answers0