yiiyii2yii-routing

Yii2 url is to long so I receive a 403 code


Is there any setting for url limit in Yii 2?

Some of my urls are over 300 characters and I get a 403 Forbidden code;

http://website/servicii-de-proiectare-asistenta-tehnica-din-partea-proiectantului-pe-perioada-derularii-lucrarilor-si-executie-de-lucrari-pentru-proiectul-%E2%80%9Emodernizare-drumuri-comunale-dc----dc----si-dc---a-de-pe-raza-comunei-lunca-judetul-boto-ani%E2%80%9D-863506-switch.html

If I shorten the url, it works.

this is my urlmanager rule:

'<title:(.*)>-<id:([0-9]+)>-access-not-granted.html' => 'member/licitatii/access-not-granted',


Solution

  • I tried to find some information regarding this issue and surprisingly enough, I didn't found a thing regarding URL length permitted.

    However, I found a Yii way to solve your issue: Short URL Yii extension presented here - http://www.yiiframework.com/extension/google-url-shortener/

    Also, please read this documentation that better explains how Yii treats URL routs: http://www.larryullman.com/2013/02/18/understanding-routes-in-the-yii-framework/

    I know this does not solve your problem directly, but hope it gets you somewhere!

    L.E: Here you have the bitly extension for Short URL's: http://www.yiiframework.com/extension/bitly-url-shortener/

    Keep on coding,
    Ares.