Answer the question
In order to leave comments, you need to log in
How to properly form cnc in yii2?
Hello. I started to learn yii2 and ran into difficulties in terms of forming cnc. I looked through many sources, including offguide, but I did not find the answer.
Tools used: php7, apache 2.4, yii2, composer. The server is localhost. Path to the application folder: С:/localhost/yii2project/.
What I tried to do:
apache settings
DocumentRoot "c:/localhost/yii2project/web"
<Directory "c:/localhost/yii2project/web">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
RewriteEngine on
RewriteRule ^(.+)?$ /web/$1
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'<action:(about|contact|login|)>' => '/site/<action>',
'<controller>/<action>' => '<controller>/<action>',
],
],
Answer the question
In order to leave comments, you need to log in
By the way, thanks to everyone who helped. Solved the problem as follows:
1) Apache settings (httpd.conf):
DocumentRoot "c:/localhost/yii2project/web"
<Directory "c:/localhost/yii2project/web">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'' => '/site/index',
'<action:(about|contact|login|)>' => '/site/<action>',
'<controller>/<action>' => '<controller>/<action>',
],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question