Hello fellow nginx users,
i currently port a project from Apache to nginx which runs on sNews ( http://snewscms.com/ )
Since 2 weeks i try now to get the damn rewrite ported, but i have no luck at all.
i use Nginx 1.0.5 stable, on Debian 6 64bit, with --configure:
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6
This is the original Apache htaccess:
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
Basically everything needs to be rewritten to index.php?category=$REQUEST - as example:
http://nohostsland.com/europe/belarusian-19-512mb-ram-kvm-vps/
-->
http://nohostsland.com/index.php?category=europe/belarusian-19-512mb-ram-kvm-vps
My current rewrite DOES work for this, it rewrites them correctly (i can access it over /europe/belarusian-19-512mb-ram-kvm-vps/) however it breaks ANY files in subfolders or even files at parent directory - and i simply have no idea why.
Thats what i use currently:
if (!-f $request_filename ) {
rewrite ^/(.*)$ /index.php?category=$1 last;
}
With !-e it wont react at all to it, with -d of course only partly - so i seem to need to use -f.
I would appreciate any help in this matter..... i am out of ideas.
Thanks!
Zhang