I have a site running yii framework with the default url structure of /index.php?r=<controller>/<view>&id=<id>
For SEO purposes, I need to change this structure to /<controller>/<view>/<id>. However, after the required changes, the old urls seems not to work. How can I make sure that the old urls redirect to new urls instead of simply opening up the home page.
I have changed my urlManager and everything works fine after a refreash fo the current page. When you say ‘old URLs’, Did you hard code the links in your code? you need to use the createUrl() functions and not hard coding.
After a couple of minutes of thought. I think that setting the showScript=>false (the one that hides index.php) you need to modify the .htaccess file to get it to work. At least there is one of the urlManager settings that needs a server access modification. Just search "yii urlManager SEO"
I have changed the url manager and edited .htaccess and it works fine in localhost. However, by old urls, I mead urls given on other websites and search engines. I want that if somebody goes to /index.php?r=api/docs referenced from search engines or other websites , it should be redirected to /api/docs instead of coming up with home page.