rewrite domain.com/index.php?show/name/title -> domain.com/show/name/title

Grzegorz Sienko staff at krecio.pl
Sat Dec 19 17:16:14 MSK 2009


Hello

I have a little problem with my rewrite and I need assist.

It's my config:
--------------------------------------
server {
listen                80;
server_name     .domain.com;
root                  /home/resources/domain/db;
index                index.php;

access_log      /home/log/nginx/domain.access.log main;
error_log          /home/log/nginx/domain.error.log error;

location ~ \.php$ {
fastcgi_pass                            127.0.0.1:9001;
fastcgi_index                           index.php;
fastcgi_param  SCRIPT_FILENAME
/home/resources/domain/db$fastcgi_script_name;
include                                    fastcgi_params;
}

rewrite ^/([^\.]+)/([^\.]+)$ /index.php?$1/$2 last;
rewrite ^/([^\.]+)/([^\.]+)/([^\.]+)$ /index.php?$1/$2/$3 last;

}

-----------------------------

and it seems to work, but with one problem. I cannot load any graphics,
javascript file etc (anything file.extension)

2009/12/19 14:58:18 [error] 26753#0: *3018846 open()
"/home/resources/domain/db/show/anime/hidamari-sketch-x-365/599/140/img/db_script.gif"
failed (2: No such file or directory), client: 84.10.8.*, server: domain.com,
request: "GET /show/anime/hidamari-sketch-x-365/599/140//img/db_script.gif
HTTP/1.1", host: "domain.com", referrer: "
http://domain.com/show/anime/hidamari-sketch-x-365/599/140//2"

File is here: domain.com/img/db_script.gif. And I don't know hot to fix it
^^. Anyone can help me? :)

-- 
Best Regards
 Grzegorz Sienko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20091219/1d1cf2bd/attachment.html>


More information about the nginx mailing list