server {
listen 80;
server_name www.haojieshao.net ;
index index.html index.htm index.php;
root /alidata/www/haojieshao/;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
//添加这块
location /
{
if (!-e $request_filename)
{
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
//添加这块END
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 3d;
}
location ~ .*\.(js|css)?$
{
expires 3h;
}
listen 80;
server_name www.haojieshao.net ;
index index.html index.htm index.php;
root /alidata/www/haojieshao/;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
//添加这块
location /
{
if (!-e $request_filename)
{
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
//添加这块END
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 3d;
}
location ~ .*\.(js|css)?$
{
expires 3h;
}
}
主要是添加这块,就可以站内配置伪静态了。