F
F
FreeAero2014-04-04 14:41:36
Yii
FreeAero, 2014-04-04 14:41:36

How to fix problem with yii2?

Hello, I started to study yii2, there are no problems with the installation. Later met with a problem.
So the frontend is located here yiinew.loc/frontend/web - working
Blog page is located here yiinew.loc/frontend/web/blog - I get the error:
Not Found
The requested URL /home/dogmar/Dropbox/www/yiinew/frontend/ web/index.php was not found on this server. (The file path is correct)
But it works if you open it like this yiinew.loc/frontend/web/index.php/blog
urlManager config:

'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'suffix' => '/',

/home/dogmar/Dropbox/www/yiinew/frontend/web/.htaccess
# Mod_Autoindex
    <IfModule mod_autoindex.c>
      # Запрещаем просмотр содержимого папок
      Options -Indexes
    </IfModule>
    
    # Mod_Rewrite
    <IfModule mod_rewrite.c>
      Options +FollowSymlinks
      # Включаем mod_rewrite
      RewriteEngine On
    
      # Если это папка или файл, открываем её/его
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      # В противном случае перенаправляем на index.php
      RewriteRule . index.php
    </IfModule>

Question: why doesn't .htaccess work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FreeAero, 2014-04-04
@FreeAero

RewriteRule . /frontend/web/index.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question