Answer the question
In order to leave comments, you need to log in
How to properly redirect requests in yii2?
The site has a page that looks like
/path/aliase
I want to make it go to /path/ and /path Redirect to /path/aliase
This code:
'/path/aliase' => 'controller/action1',
'/path/' => 'controller/action2',
Answer the question
In order to leave comments, you need to log in
I solved this problem with htaccess
RewriteBase /
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteRule ^(.*)(/)$ $1 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question