Commit 1b785495354773833b7f652a5119795a8d8998cb
1 parent
abe4455d
404 на / в конце
Showing
2 changed files
with
14 additions
and
3 deletions
Show diff stats
frontend/components/UrlManager.php
... | ... | @@ -70,8 +70,18 @@ |
70 | 70 | public function parseRequest($request) |
71 | 71 | { |
72 | 72 | // $this->checkRedirect($request->url); |
73 | - | |
73 | + | |
74 | 74 | $request = $this->parseLanguage($request); |
75 | + $path=$request->pathInfo; | |
76 | + | |
77 | + if($path[strlen($path)-1]=='/' | |
78 | + # && $path[strlen($path)-2]=='/' | |
79 | + ) | |
80 | + { | |
81 | + throw new NotFoundHttpException(); | |
82 | + } | |
83 | + | |
84 | + | |
75 | 85 | /** |
76 | 86 | * @var Alias $alias |
77 | 87 | */ |
... | ... | @@ -130,7 +140,7 @@ |
130 | 140 | return $prefix . '/' . $params[ 'alias' ][ 'value' ]; |
131 | 141 | } |
132 | 142 | } |
133 | - | |
143 | + | |
134 | 144 | return $prefix . parent::createUrl($params); |
135 | 145 | } |
136 | 146 | |
... | ... | @@ -170,7 +180,7 @@ |
170 | 180 | \Yii::$app->end(); |
171 | 181 | } |
172 | 182 | } |
173 | - | |
183 | + | |
174 | 184 | return $request; |
175 | 185 | } |
176 | 186 | ... | ... |
frontend/config/main.php