Hello all
I'm having a problem setting up a PHP framework with a Wordpress installation as a subdirectory.
The set up:
example.com/blog needs to be handled by Wordpress
exmple.com/* everything else needs top be re-written to the index.php file of the framework
The framework works perfectly, even serving static files (images) from a subdirectory, but WP is returning a 404 when it goes to the installation step (/blog/wp-admin/install.php).
The current semi-working config is:
[code]
server {
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
server {
listen 80;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
location /blog {
set $php_root /var/www/example.com/public/blog;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location /socializer {
set $php_root /var/www/example.com/public/socializer;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location / {
set $php_root /var/www/example.com/public;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
## Images and static content is treated differently
location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
access_log off;
expires 30d;
root /var/www/example.com/public/;
}
## Parse all .php file in the directory
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_pass backend;
}
## Disable viewing .htaccess & .htpassword
location ~ /\.ht {
deny all;
}
}
upstream backend {
server 127.0.0.1:9000;
}
[/code]
What's going on? How can I setup nginx to rewrite the blog directory to WP and everything else to the framework?
Thanks,
Pierre