php站点伪静态配置(Apache+Linux)

 404报错

404 Not Found

nginx/1.15.11


问题解决

1、Linux

location / {

        if (!-e $request_filename) {

                rewrite ^(.*)$ /index.php?s=/$1 last;

        }

}

2、Apache


 RewriteEngine on
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]

你可能感兴趣的:(php,linux,apache,伪静态)