############# for apache 2.x系列 部分路径视程序路径请自行修改 #########
RewriteEngine on

#伪静态设置

RewriteCond    %{REQUEST_FILENAME} !-d
RewriteCond    %{REQUEST_FILENAME} !-f
RewriteRule    !\.(js|ico|gif|swf|flv|jpg|png|css|zip|rar|tar|pdf|mp3|wav|rmvb|rm)$ index.php [QSA,L]

#压缩输出
<FilesMatch "\\.(js|css|html|htm|php|xml|jpg|gif|png|bmp)tiny_mce_markerquot;>
SetOutputFilter DEFLATE
</FilesMatch>

#401-500 错误设置
ErrorDocument 401 /errors/internalerror.php
ErrorDocument 402 /errors/internalerror.php
ErrorDocument 403 /errors/internalerror.php
ErrorDocument 404 /errors/internalerror.php
ErrorDocument 500 /errors/internalerror.php

########### for nginx  记得修改后 重启nginx服务器 ############



找到  location / {
	
     }

  在里面加入
  	if (!-e $request_filename) {
	 rewrite ^/(.*) /index.php?$1&;
	}
注意此方式在伪静态模式下遇到.php的后缀会出现异常

完整例子:
server {
    listen       89;
    server_name  localhost;
    location / {
        root   /shop/www;
        index  index.html index.htm index.php default.php;
	if (!-e $request_filename) {
	 rewrite ^/(.*) /index.php?$1&;
	}
	if ($fastcgi_script_name ~ \..*\/.*php ) {
		return 403;
	}
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
    location ~ .*\.php?$ {
        root           /shop/www;
        fastcgi_pass   127.0.0.1:9000;
	fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /shop/www$fastcgi_script_name;
        include        fastcgi_params;
    }
}