Application's Url

Hey Guys!!

I hope that you can help me!!

I am developing a system using Yii framework. This application is available in 3 enviroments(Development, Intranet and Extranet). In the two first enviroments the application works fine. In the Extranet, the application is acessed by https:://aplic.mybusiness.com/application, however, this address just redirect to Intranet’s environment (http://application.mybussines.com). This way, the yii framework is generating links and form’s action based in the intranet’s address.

For example:

a link that must be generated in this way

[color="#FF0000"]<a href="/application/index.php/controller/action">Link 1</a>[/color]

It’s been generated like this (without the subdirectory application):

[color="#FF0000"]<a href="/index.php/controller/action">Link 1</a>[/color]

for this reason, when someone click in one of these links, obviously a message of "page nout found" is displayed.

does someone have idea how fix this problem? Maybe a UrlManager rule?

sorry about my english :)

have a nice day … bye

I don’t think that basePath is correctly configured within your applications (use separate configurations for either setup).

Hi Emile Bons, thanks for answering …

I forgot to mention it … I already have 3 configuration files, one for each environment …

In the application components (request), I set the following parameters:




'request'=>array(

     'enableCsrfValidation'=>false,

     'baseUrl'=>'/application'

),    



Is it correct? or should I change in somewhere else?

I would have a look at the ‘basePath’ parameter; the first one in my config files after ‘return array(’.

I changed the basePath content and it doesn’t work … I guess that this parameter is about the folder where the application is stored … because, i did print_r(Yii::app()->basePath) and it displays:

/apps/www/php5_production/html/application/gopseo/protected

another idea?

Yes, your right, my fault. I think, reading your opening post the second time, that this problem is caused by the way you redirect in the beginning. Having a look at our config, url’s are being created the correct way (including the app name path) whenever pages are loaded from that directory. You could create app-specific url rules or write your custom url manager but the best thing might be to figure out how to redirect the correct way.

I’ll see waht is happening … although, I don’t even know where to start :D

anyway, thanks for your help … bye