Captcha Problem With Urlformat Path

Hi i have these UrlManager settings




'class'=>'application.components.UrlManager',

'urlFormat'=>'path',

'showScriptName'=>false,

'rules'=>array

(

  '<language:(en|zh)>/' => 'site/index',

  '<language:(en|zh)>/<action:(contact|login|logout)>/*' => 'site/<action>',

  '<language:(en|zh)>/<controller:\w+>/<id:\d+>'=>'<controller>/view',

  '<language:(en|zh)>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

  '<language:(en|zh)>/<controller:\w+>/<action:\w+>/*'=>'<controller>/<action>',



Captcha is not displaying for me and i found that originally the captcha url is

localhost/index.php?r=site/captcha&v=516f9a0fa72c0

now it changed to

localhost/en/captcha/v/516f9a0fa72c0

How could i solve the problem?

Thanks.

localhost/en/captcha/v/516f9a0fa72c0 <- Does this "page" work if you open it manually? What is the error?

You can also try to add a rule (in the begining): ‘captcha’=>‘site/captcha’

Hi there

this should solve your problem




'class'=>'application.components.UrlManager',

'urlFormat'=>'path',

'showScriptName'=>false,

'rules'=>array

(

  '<language:(en|zh)>/' => 'site/index',

  '<language:(en|zh)>/<action:(contact|login|logout|captcha)>/*' => 'site/<action>', // you can add the captcha action in here

  '<language:(en|zh)>/<controller:\w+>/<id:\d+>'=>'<controller>/view',

  '<language:(en|zh)>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

  '<language:(en|zh)>/<controller:\w+>/<action:\w+>/*'=>'<controller>/<action>',

Ok actually the url is

localhost/en/site/captcha/v/517770f04f484

If i open it manually in browser it will just show an empty image.

Tried added ‘captcha’=>‘site/captcha’ and the url changed to

localhost/captcha?v=5177763bacdb5&language=en

Still not working.

Then i try added ‘<language:(en|zh)>/captcha’=>‘site/captcha’ and url changed to

localhost/en/captcha?v=517776b26cbdd

Not working too.

Where does the captcha image being generated/stored? I want to check if the image actually exists or not.

Hi alirz, i try added

‘<language:(en|zh)>/<action:(contact|login|logout|captcha)>/*’ => ‘site/<action>’,

and the captcha url changed to

localhost/en/captcha/v/517777b17076f

and it’s not working too.

how about your login and contact page, are they working fine, its weird and also remove the asterisk in the end

‘<language:(en|zh)>/<action:(contact|login|logout|captcha)>’ => ‘site/<action>’,

Contact login logout all working good. Actually the captcha is applied at contact page.

Anyway, i tried both

‘<language:(en|zh)>/<action:(contact|login|logout|captcha)>’ => ‘site/<action>’,

and

‘<language:(en|zh)>/<action:(login|logout|captcha)>’ => ‘site/<action>’,

it’s still not working, just show empty image. I really need to know where’s the image actually being generated and saved to? Temp file or memory?