[Environment] Ubuntu120432bitAMH panel 42Nginx144PHP5327ThinkPHP312 ----------------------------------- not very gorgeous split line --------------------------------- is actually directly writing rewri
[Environment]
Ubuntu 12.04 32bit
AMH panel 4.2
Nginx 1.4.4
PHP 5.3.27
ThinkPHP 3.1.2
--------------------------------- Not very gorgeous split line ---------------------------------
In fact, the rewrite file is directly written. I don't know the specific syntax of Baidu. I just barely finished it after half-copy and half-modify the file on the internet. the rewrite content is released below:
Note: I directly configure the Nginx virtual host on AMH, so the path may be different.
Before writing a rewrite statement, set the location in the corresponding website configuration under the original vhost ~ * \. Php $ {} comment or delete the entire file (pay attention to backup !!)
Location /{
Index. php;
If (! -E $ request_filename ){
Rewrite ^/(. *) $/index. php/$1 last;
Break;
}
}
Location ~ . * \. Php
{
Set $ path_info "";
Set $ real_script_name $ fastcgi_script_name;
If ($ fastcgi_script_name ~ "^ (. + ?. Php) (/. +) $ "){
Set $ real_script_name $1;
Set $ path_info $2;
}
Fastcgi_pass unix:/tmp/php-cgi-myar.kollway.com.sock;
Fastcgi_index index. php;
Include fcgi-host.conf;
Fastcgi_param DOCUMENT_ROOT/web $ subdomain;
Fastcgi_param SCRIPT_FILENAME/web $ real_script_name;
Fastcgi_param PATH_INFO $ path_info;
}
--------------------------------- Not very gorgeous split line ---------------------------------
References:
Http://www.codesth.com/%E4%B8%8D%E7%94%A8rewrite%E5%85%BC%E5% AE %B9%EF%BC%8C%E8%A7%A3%E5%86%B3nginx%E4%B8%8D%E6%94%AF%E6%8C%81thinkphp-pathinfo%E6%A8%A1%E5%BC%8F/
Http://blog.csdn.net/realghost/article/details/9082847