V
V
Vanik Khachatryan2017-11-29 22:05:41
ubuntu
Vanik Khachatryan, 2017-11-29 22:05:41

Why does .htaccess on Ubuntu server not see the folder and files?

Site structure:

-public
   -index.php
   -images
-app
   -controllers
   -models
....

So, at the level with the public and app folders, there is .htaccess, the contents of which are as follows:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^$ public/     [L]
    RewriteRule (.*) public/$1 [L]
</IfModule>

When you try to enter the site, you get File not found.
How can I fix this, and is it really a problem in .htaccess, otherwise I'm thinking about the .conf of the host

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-11-29
@VaniXac

You need to direct the server to the public folder in httpd.conf
DocumentRoot "path/to/public"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question