Get the url of the article for the blog

Hello there. I recently started learning Yii2. Now I want to turn my CMS site into Yii2. There are about 100 articles on my site and many users read this article. my goal is to move articles to Yii2 without deleting any of them and changing the url

Articles on my site: site/blog/cagory/article-name.html

When you go to, articles related to that category will appear. How do I get url addresses? I will check those received urls and redirect them to 404 pages if they do not appear in the database.

Additional articles


both appear to be the same article

Canonical URL’s and, maybe some redirection rules, some work with urlManager around? Just guessing, because you didn’t provide more info.

I have a Yii site that links to WordPress posts stored on a subdomain with a separate database. Then I have getPosts, getComments, etc. functions to retrieve them. Are you wanting to do something similar?