.htaccess not working right ubuntu 14.04

November 9, 2015 2k views
DigitalOcean Apache LAMP Stack PHP Ubuntu

Hello there i just finished setting up my server and all my code files but im having a problem. Whenever i go to it gives me a error that says that the /public/index file is not found.

The way my site is setup is all the requests goes to the public folder which holds my index.php file that routes all of my pages. Not on my local server everything works flawlessly but on my digitalocean server whenever i go to the index page it dosent works. But if i go to the pages loads perfectly. So this is how my .htaccess file looks in my public folder which routes all my pages and requests:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


Also here is the .htaccess file thats in the root of my website. It routes all the calls to the public folder:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    public/    [L]
    RewriteRule    (.*) public/$1    [L]

I just want to know how i can fix the problem where when i load my index page, it says that the file isnt found. When its a actual page.

Be the first one to answer this question.