I am using advanced app and noticed that when I changed name of the controller using urlManager it is accessible by the old name and it is possible to open with new url name as well.
How can I disable old name and redirect old to new?
Assume that I had:
site/<action>
now I have:
website/<action>
both of them work properly, but I would like to redirect site/<action> to website/<action> permanently
Let’s say you start with a controller named SiteController. It’ll serve all requests to “site/…”.
Now you add a rule to your UrlManager that maps all calls to "website/…" to SiteController. Yii will still find the controller for "site/…" requests, meaning both "site/…" and "website/…" work. This is your current status, from what I understand.
.htaccess (or httpd config) allows you to redirect (301) all requests from “site/…” to “website/…”. Yii isn’t involved in this redirect and it’s a fast and simple solution.
If you change the name of your Controller from SiteController to NewSiteController, you won’t have to touch .htaccess, only UrlManager.
If you decide to abandon "website/…" and redirect it to "mynewurl/…", you have to add an entry to .htaccess.