Add a default parameter to all urls


I would like to create 2 applications (they will be the same in 98% except for showing some elements) so I decided to design only one app and add parameters to url which will tell what kind of elements show.

for example



If user open an application with a one param I would like to keep his preferences. Keeping the param "apptype" in the url is what I need (or at least I think so).

I think that I can do this in two ways:

  1. Add manually the param to ALL links (but if I forget to add it will change the look of app)

  2. Store param in session and than take it from there and put in url (a little bit automatic)

Question: Is there any better way to do this using yii?:)

Best regards,


may be you can try it with url rules manager from yii.but that will more complicated way…i haven’t try this but yeah at least you can try this at once…

or if this doesn’t work for you then your suggested idea 1 would be great option…but you have to concentrate well while writing a code… :P


  1. How can I use “url rules manager” to do so? :)

  2. Maybe, I should use subdomain as parametr? If it is possible

Check this similar thread for some ideas -