1
  1. apache:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
  1. nginx:
server {
        listen       80;
        server_name  dev.guanjia.com ;
        root   "F:\phpstudy\PHPTutorial\WWW\zhifaguanjia\Web";
        location / {
            index  index.html index.htm index.php;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}
居圣 7
7月12日提问

1 个回答

0

试试这个

root   "F:\\phpstudy\\PHPTutorial\\WWW\\zhifaguanjia\\Web";
# 或者去掉双引号
root   F:\phpstudy\PHPTutorial\WWW\zhifaguanjia\Web;

location / {
    index  index.html index.htm index.php;
    try_files $uri $uri/ /index.php$request_uri;
}

推广链接