Phpshe-commerce Mall system Configuration Nginx support PathInfo and rewrite notation

Source: Internet
Author: User

Locate the/usr/local/webserver/nginx/conf/nginx.conf file (environment configuration is different, the path may not be the same)

And in the server {... Omitted code to add the following code (if the program is placed in the root directory with a first-level directory code, placed in the level two directory, please use the level two directory code), and then restart Nginx:



############## #开启pathinfo支持(Please ignore here if it is turned on) ##############

Location ~ \.php {Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Include fcgi.conf;
Set $real _script_name $fastcgi _script_name;
if ($fastcgi _script_name ~ "^ (. +?\.php) (/.+) $") {
Set $real _script_name $;
Set $path _info;
}
Fastcgi_param script_filename $document _root$real_script_name;
Fastcgi_param script_name $real _script_name;
Fastcgi_param path_info $path _info;}


############## #配置伪静态 (hidden index.php in a level directory) ##############

if (!-e $request _filename) {
# # #程序放在一级目录下 (eg: http://www.phpshe.com/)
Rewrite ^/(. *) $/index.php/$1 last;
}


############## #配置伪静态 (hidden under Level Two directory index.php) ##############

if (!-e $request _filename) {
# # #程序放在二级目录下 (eg: http://www.phpshe.com/shop/)
Rewrite ^/two level directory name/(. *) $/Two level directory name/index.php/$1 last;
}

Phpshe-commerce Mall system Configuration Nginx support PathInfo and rewrite notation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.