php 伪静态配置 nginx Apache

Nginx

location / { 
  if (!-e $request_filename) {         
    rewrite ^(.*)$ /index.php?s=$1 last; 
    break;     
  } 
}

Apache

<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>

网站->管理->修改 粘贴就行

你可能感兴趣的:(php,php,nginx,apache)