动态网址生成器故障

We build site upon Yii (1.1.13); it's car pare parts shop & transaction management engine. When given for its SEO inspection to the SEO company and the company concluded the result:

  1. Found 15000 dynamic urls ('obviously not all' - my comment)
  2. ~8 000 of them seems being long, like this: http://tarex.ru/index.php?r=assortment/index&id=1536&Subsystem=Warehouse+automation&Reference=Assortment&Assortment_page=9&Assortment_sort=title.desc
  3. Only 300 pages registered in a search engine to now.
  4. 500 of them are mistaken url or no response (response code 500). Ulrs are like this: http://tarex.ru/index.php?r=assortment/index&Assortment[groupCategory]=4&Assortment_page=46&Assortment_sort=agroup.desc ('most likely cause of assortment reloading/renewed in db' - my comment) . They stated these failures (for point 4) are cause of dynamic url generator failures.

The assortment in the db is dynamicly updated daily.

The company suggested to solve the dynamic url generator issue or not to use it in favour of user-friendly URLs/SEO-friendly URLs.

How to fix dynamic url generator failures and if it's possible to use smth. else as suggested?

Update

Url management configuration has been off so far:

// uncomment the following to enable URLs in path-format
    /*
    'urlManager'=>array(
        'urlFormat'=>'path',
        'rules'=>array(
            '<controller:\w+>/<id:\d+>'=>'<controller>/view',
            '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
            '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
        ),
    ),
    */

When i uncommented it the site works well yet some of subsystem menus does not function cause are bound to some GET parameters...

Recently did something like this for a shop.

Usually you will do this:

1) For each dynamic url dynamically make it's clean url arternative

2) Redirect from old to clean url.

3) PROFIT!

Now as for the details:

The most tricky part is understanding whether the new url can be formed and if so, redirect to it. I think you can do this either in a customUrlRule (which is a bit dirty) or a controller (which I like more).

Let us assume you've chosen a controller: In a controller's action, determine whether there is a new url user came from. If there is AND REQUEST URL!==NEW URL you are just proceeding with controller logic. If not, you are redirecting to the new url. I think it should be comfortable if

1) both url types are processed with the or different controller and action, and include the logic described above.

2) You are using some kind of method to give the url of a new and old type, passing the same parameters to them. For example, you may use Yii::app()->createUrl($params) for new type of Url, and some custom method, i.e. $myModelInstance->createUrl($params)

3) New urls are being built and processed with custom URL rule

4) In your url manager, you have your custom rule for new urls and ordinary rule for older urls in this precedence.

To sum it up:

If the user goes from old url, the controller action is executed, where some additional checks are made. We are checking if a new url can be built, we also can check some additional things, i.e. sync with some additional seo url database, to know whether this url needs to be redirected. If new url can be built - we redirect to it. The browser requests a request, which is parsed with your custom url rule, and corresponding controller and action is executed.