Answer the question
In order to leave comments, you need to log in
How to remove default from yii2 module?
Example url:
site.ru/module/
'<action>'=>'site/<action>',
'<module:\w+>/<action:\w+>/<id:(.*?)>' => '<module>/default/<action>/<id>',
'<module:\w+>/<action:\w+>' => '<module>/default/<action>/',
'<module:\w+>/' => '<module>/default/',
addDefaultCharset utf8
Options +FollowSymLinks
IndexIgnore */*
# If a directory or a file exists, use it directly
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php
Answer the question
In order to leave comments, you need to log in
'<module:\w+>/<action:\w+>/<id:(.*?)>' => '<module>/default/<action>/<id>', //тут лишнее <id>'
//надо так:
'<module:\w+>/<action:\w+>/<id:(.*?)>' => '<module>/default/<action>',
'<action>'=>'site/<action>',
'<module:\w+>/<action:\w+>/<id:(.*?)>' => '<module>/default/<action>',
'<module:\w+>/<action:\w+>' => '<module>/default/<action>',
'<module:\w+>' => '<module>/default/index',
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question