I'm new to Yii and i'm having troubles setting up the config on a remote server. Locally, everything works great, but on the server, using the exact same GH repo including config/main.php, none of the links seem to work.
for example , in site/index, i have a link to /video/index however, whenever i click the link, the path is added like : /site/video/index. and pressing it repeatedly will add more /video/ in front.(/site/video/video/video/video/index). ->note this only happens on the server and not locally.
things that i've tried: manually inserting pretty and ugly urls in the browser bar, nothing worked. actually, anything i add after .com (.com/asdfbfdgvdipgfbsd/ ) will just render the site/index page, with the path i write remaining in the bar, but content being not an error or anything else, just my main index file.
how i managed to access the videos page:
setting 'defaultUrl' => '/video/index' (instead of site/index), but this doesn't help as obviously i can only access this page now.
commenting out 'urlFormat'=>'path' ----> this allows me to get to the video page from my site/index page , but this results in the following path displayed in the browser: /video/?r=video/index. Now, in this page i display 20 video thumbnails and have included a self-loading gallery (magicScroller). locally it works fine, more thumbs being added as i scroll down. however, in this config from the server, instead of more thumbs being rendered, i am getting /site/index page rendered below the first videos batch.
here is my 'components'->UrlManager from main.php config file:
'urlManager'=>array(
//'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
i tried adding 'enablePrettyUrl'=>true, but this results in the error: Property "CUrlManager.enablePrettyUrl" is not defined.
note. locally everything works perfect, paths look normal (no double /video/video or anything peculiar)
Not sure what else to check and try so looking forward to hearing from this community of brilliant minds:)
EDIT: here is the config. maybe it sheds a bit of light on my issue
server {
listen 80;
server_name my.site.com;
#charset koi8-r;
access_log /var/log/nginx/my.site.com.access main;
root /www/my.site.com/public;
location / {
index index.html index.php;
try_files $uri $uri/ index.php?$args;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#let yii catch the calls to unexising PHP files
set $fsn /index.php;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/fastcgi.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
#PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml|map)$ {
try_files $uri $uri/ =404;
#log_not_found off;
expires 1d;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}