Commit 7dfb61f28968b9a50d830863b5aee6e21d67000e
1 parent
8f7c59fa
redirect fix2
Showing
1 changed file
with
3 additions
and
4 deletions
Show diff stats
frontend/components/UrlManager.php
@@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
72 | public function parseRequest($request) | 72 | public function parseRequest($request) |
73 | { | 73 | { |
74 | $redirect = $this->checkRedirect($request->url); | 74 | $redirect = $this->checkRedirect($request->url); |
75 | -// die(var_dump($redirect)); | 75 | + |
76 | if ($redirect !== null) { | 76 | if ($redirect !== null) { |
77 | 77 | ||
78 | \Yii::$app->response->redirect("/" . $redirect->value, 301); | 78 | \Yii::$app->response->redirect("/" . $redirect->value, 301); |
@@ -213,10 +213,9 @@ | @@ -213,10 +213,9 @@ | ||
213 | $string .= '}'; | 213 | $string .= '}'; |
214 | 214 | ||
215 | $alias = Alias::find() | 215 | $alias = Alias::find() |
216 | - ->where(['route' => trim($string)]) | 216 | + ->where(['like', 'route', $string]) |
217 | + ->limit(1) | ||
217 | ->one(); | 218 | ->one(); |
218 | -// die(var_dump(Alias::find() | ||
219 | -// ->where(['route' => $string])->createCommand()->rawSql)); | ||
220 | return $alias; | 219 | return $alias; |
221 | 220 | ||
222 | 221 |