J
J
JhaoDa2013-07-09 16:36:18
Apache HTTP Server
JhaoDa, 2013-07-09 16:36:18

.htaccess without index.php

There was a task to redirect all requests from the root directory to a subdirectory. I put in the
root with the content:/www/example.com.htaccess

Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine on
RewriteRule . app/index.php [QSA]

Should redirect everything to /www/example.com/app/index.php.
But it does not redirect until you put it in /www/example.coman empty index.php, otherwise an error
AH01276: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
or if we remove -Indexes, then
AH01630: client denied by server configuration: /www/example.com/.htaccess

Google suggests that this is treated through something like
<Directory "%hostdir%">
 AllowOverride all
 Require all granted
</Directory>
But this is a regular virtual hosting, there is no access to httpd-vhost.

Question: how to do without empty index.php? He, of course, does not ask for porridge, but his eyes are callous.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
truekenny, 2013-07-09
@JhaoDa

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

The root request is empty. And you have a "point" - 1 any character.

A
Andrey Burov, 2013-07-09
@BuriK666

DirectoryIndex disabled

L
LAA, 2013-07-09
@LAA

Here's what's different:

A single argument of "disabled" prevents mod_dir from searching for an index. An argument of "disabled" will be interpreted literally if it has any arguments before or after it, even if they are "disabled" as well.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question