From efc64470d73d5ee7eb48a1807a93c1c19a8a9ab8 Mon Sep 17 00:00:00 2001 From: Mihail Date: Wed, 26 Aug 2015 10:11:56 +0300 Subject: [PATCH] edit routing - work version --- .htaccess | 36 ++++++++++++++++++------------------ common/config/main.php | 7 ++----- frontend/config/main.php | 5 +++++ 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.htaccess b/.htaccess index 984d5d3..c73d62e 100644 --- a/.htaccess +++ b/.htaccess @@ -1,18 +1,18 @@ -#Mod_Autoindex -# -# # Запрещаем просмотр содержимого папок -# Options -Indexes -# -# -#Mod_Rewrite -# -# Options +FollowSymlinks -# # Включаем mod_rewrite -# RewriteEngine On -# IndexIgnore */* -# # Перенаправляем administrator на входной скрипт админки -# RewriteRule ^administrator/(.*)?$ /backend/web/$1 [L,PT] -# RewriteRule ^storage/(.*)?$ /storage/$1 [L,PT] -# # Перенаправляем все запросы на входной скрипт -# RewriteRule ^([^/].*)?$ /frontend/web/$1 -# \ No newline at end of file +# Mod_Autoindex + + # Запрещаем просмотр содержимого папок + Options -Indexes + + +# Mod_Rewrite + + Options +FollowSymlinks + # Включаем mod_rewrite + RewriteEngine On + IndexIgnore */* + # Перенаправляем administrator на входной скрипт админки + RewriteRule ^administrator/(.*)?$ /backend/web/$1 [L,PT] + RewriteRule ^storage/(.*)?$ /storage/$1 [L,PT] + # Перенаправляем все запросы на входной скрипт + RewriteRule ^([^/].*)?$ /frontend/web/$1 + \ No newline at end of file diff --git a/common/config/main.php b/common/config/main.php index 3db6873..4de99aa 100644 --- a/common/config/main.php +++ b/common/config/main.php @@ -6,10 +6,7 @@ return [ 'cache' => [ 'class' => 'yii\caching\FileCache', ], - 'urlManager' => [ - 'enablePrettyUrl' => true, - 'showScriptName' => false, - 'rules' => $rules, - ], ], ]; + + diff --git a/frontend/config/main.php b/frontend/config/main.php index 1ed8305..27e8339 100644 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -28,6 +28,11 @@ return [ 'errorHandler' => [ 'errorAction' => 'site/error', ], + 'urlManager' => [ + 'enablePrettyUrl' => true, + 'showScriptName' => false, + 'rules' => ['module///' => '//'], + ], ], 'params' => $params, ]; -- libgit2 0.21.4