CUrlManager problem

I have a problem and I dont know that is bug or maybe I do something wrong.

this is my urlmanager config



'showScriptName'=> false,



and now I prepare url



and value1 (abc%2Fabc) contains %2F, its encoded ‘/’

if I try open this url I have exception (server error 404 not yii exception)

Maybe someone could explain me how I can pass this variable (/) in url.


Have you setup your .htaccess file to rewrite the URL?

Check out :

its my htaccess configuration (its default configuration)

Options +FollowSymLinks

IndexIgnore */*

RewriteEngine on

# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php

RewriteRule . index.php

Possible reasons:

  • your webserver is not Apache -> Find out what to use instead of mod_rewrite

  • your webserver doesn’t have mod_rewrite -> Try to enable/install that module

  • your webserver doesn’t read .htaccess files -> Add a AllowOverride All for your webroot directory in your Apache conf.

My server version is Apache/2.2.12, mod_rewrite module is enabled

this is a part my apache.conf


        ServerAdmin webmaster@localhost

        ServerName localhost

        DocumentRoot /home/xxx/public_html

        ErrorLog /var/log/apache2/error.log

        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

        <Directory /home/xxx/public_html/>

            Options Indexes FollowSymLinks MultiViews

            [b]AllowOverride All[/b]

            Order allow,deny

            allow from all



I know that is not Yii problem, but I dont understand it and cant explain.

When I use ‘/’ char after ‘?’ char url is reading like I expect,

but when url has ‘path’ format


then param_key/abc%2Fabc is including to context part, and server try find


(this context doesnt exit in my app)

Try to add this to your vhost config:

AllowEncodedSlashes On

By default most Apache installations give a "404 Not found" if a URL contains a %2F.

thnaks, it works but its only part of solution ;)

Now server redirect this request to index.php properly,

but Yii urlManager handle this request incorrect.

I have url rule


and in my IndexAction i have

class IndexAction extends CAction {

  public function run() {




First case, I try open url

and Yii throws exception

The system is unable to find the requested action [b]"beggin"[/b].

In this case beggin%2Fend should be value of var.

Second case, I try open

Yii properly opens test/index action, and my dump shows



    [var] => 'beggin'

    [end] => ''


This is a part of function parseUrl from class CUrlManager (Yii Framework)

	public function parseUrl($request)






			foreach($this->_rules as $rule)



					return isset($_GET[$this->routeVar]) ? $_GET[$this->routeVar] : $r;


this function firstly use of urldecode function on whole path and next reads rules from path,

its a bug or it should works that???

I fix this problem, I build my url in different way.

I dont use variables keys in my url rules, but its not a solution!

Maybe you’re right. But not sure, why urldecode is used here but it’s surely there for a reason. Maybe also check CUrlRule::parseUrl() to find out more.

Same error here. Confirm this is a bug… Or we don’t get something? :)