F
F
fragsteelpad2017-09-01 15:34:20
Yii
fragsteelpad, 2017-09-01 15:34:20

Invalid .htaccess?

Deployed the project on Yii2. Everything works for one person, but for me Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
.htaccess file :Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
AddDefaultCharset UTF-8
php_value default_charset UTF-8
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule ^admin\/?(.*) /backend/web/$1
RewriteCond %{REQUEST_URI } !^/(frontend/web|backend/web|admin)
RewriteRule (.*) /frontend/web/$1
RewriteCond %{REQUEST_URI} ^/frontend/web RewriteRule . /frontend/web/index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} ! -d
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php
Module_rewrite is enabled in Apache configs. What could be wrong.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
EverOne, 2017-09-01
@fragsteelpad

# Enable mod_rewrite
    RewriteEngine On
    RewriteBase /

M
Maxim Timofeev, 2017-09-01
@webinar

Isn't it easier to throw the contents of / frontend / web into the public folder, create the admin folder in it and throw the contents of / backend / web into it.
In this case, htaccess will be small and fluffy like:

RewriteEngine on

# hide files and folders
RedirectMatch 404 /\.git
RedirectMatch 404 /composer\.
RedirectMatch 404 /.bowerrc

# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php

RewriteRule . index.php

There is another question, but do you have nginx? Then your attempts with htaccess may be generally useless.

V
Viktor Taran, 2017-09-02
@shambler81

And it will be even easier to make your own .htaccess in each folder.
Do not forget that .htaccess can lie both in the root and in lower folders, blocking higher rules.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question