nginx实现带参数目录域名重定向二级域名方法
类似把www.cmniu.com/feefef/368.html 定向到 http://game.wap118100.cn/11/368.html
location / {
rewrite ^/.*/(.*)$ http://game.wap118100.cn/11/$1 permanent;
}
##重定向到
location / {
root /alidata/www/game;
index index.html index.htm index.php;
rewrite ^/(\d+)\/(.*)\.html$ /html/app/$2.html last;
}
##转发php到9000端口解析
location ~^(.+\.php)(.*)$ {
root /alidata/www/game;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param