|
楼主 |
发表于 2010-5-22 10:29:45
|
显示全部楼层
把规则改成 rewrite ^/work(.*)$ http://$host/work/index.php$1 last;试试
也就是将最后的permanent改为la ...
haohailuo 发表于 2010-5-22 07:17
我试了下 仍然没用 我的nginx.conf里这个server是这样写的 是不是和其他的location有关系
server
{
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /soft/vshare/htdocs;
location /
{
if ( -d $request_filename )
{
rewrite "^/(.*)([^/])$" http://$host/$1$2/ permanent;
}
}
location /work/
{
rewrite ^/work(.*)$ http://$host/work/index.php$1 last;
}
location ~ ^(.+\.php)(.*)
{
include fcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$")
{
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /soft/logs/access.log access;
}
server
{
listen 80;
server_name localhost;
location / {
stub_status on;
access_log on;
}
} |
|