Closed munggruel closed 11 years ago
I use virtual host too, but I have no problem with this. Give me you .htaccess and virtual host config content here, please. Maybe we need use volt's 'url' helper to adjust full path with baseURL parameter.
httpd.conf add Include conf/extra/*.conf
virtual host: <VirtualHost *:80>
ServerAdmin admin@example.host
DocumentRoot "D:/MiniServer/www/htdocs/phalconeye/public"
DirectoryIndex index.php
ServerName dev.phalconeye.com
#ServerAlias www.example.host
<Directory "D:/MiniServer/www/htdocs/phalconeye/public">
Options All
AllowOverride All
Allow from all
</Directory>
phalconeye/.htaccess:
phalconeye/public/.htaccess: AddDefaultCharset UTF-8
for apache, I can't access public/img for nginx, I can't access any page except public/index.php nginx.conf add include extra/*.conf;
extra/phalconeye.conf: server { listen 80; server_name dev.phalconeye.com; set $root_path 'D:/MiniServer/www/htdocs/phalconeye/public'; root $root_path;
#access_log /var/log/nginx/$host-access.log;
#error_log /var/log/nginx/$host-error.log error;
access_log logs/phalconeye_access.log main;
error_log logs/phalconeye_error.log debug;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=$1;
}
location ~ \.php {
# try_files $uri =404;
fastcgi_index /index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}
Hm, maybe problem in:
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
This rule rewrite /img/someimg.png to root and apache rewrite rule then in /public/ dir...
And I didn't understand why u have nginx rewrite like this:
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=$1;
}
index.php not in root, it's in /public dir
P.S. Btw all links must be with baseURL parameter, so i will change them with 'url' helper, but this will not fix your problem...
Oh, i see, sorry $root_path is 'D:/MiniServer/www/htdocs/phalconeye/public'. Okay, i will check it manually
For apache i find your problem:
<Directory "D:/MiniServer/www/htdocs/phalconeye/public">
must be:
<Directory "D:/MiniServer/www/htdocs/phalconeye">
And above DocumentRoot, too
My config come from phalcon official website: http://docs.phalconphp.com/en/latest/reference/nginx.html
For apache you can't access public dir because this dir is root in your config. For nginx - the same...
But you give me the right way... that application code must be hidden and public must be root. I will rework that.
for example: app\modules\Core\View\adminpages\manage.volt
<img src="/public/img/admin/content/cols1_3.png" alt="3 columns" onclick="changeCurrentLayoutType('right,middle,left');"> should be
<img src="/img/admin/content/cols1_3.png" alt="3 columns" onclick="changeCurrentLayoutType('right,middle,left');">
delete "/public/"