A
A
Alexander Ivanov2017-04-30 10:46:45
PHP
Alexander Ivanov, 2017-04-30 10:46:45

How to configure a single entry point on apache?

/public/.htaccess

AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [PT,L]
</IfModule>

/.htaccess
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
    RewriteEngine On
#    RewriteCond ^$ public/ [L]
    RewriteRule (.*) public/$1 [L]
</IfModule>

The confusing thing is that if I enter such a path site.loc/ or site.loc/public/ both paths will open, but I would like without public. Although apparently not only, this is not a public matter. all paths open index.php apparently I will set 404 and it will be normal.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Bukharev, 2017-04-30
@evgenybuckharev

You need to configure the domain config in Apache itself, using the DocumentRoot
directive
/www/example.com/www/frontend/web/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question