tp5.1 去掉index.php nginx

原来的路径是:

http://xxxxxxx/index.php/admin/login/index.html

修改完的路径:

http://xxxxxxx/admin/login/index.html

修改.htaccess文件


  Options +FollowSymlinks -Multiviews
  RewriteEngine On


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

nginx

  修改配置文件

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

 

 

你可能感兴趣的:(PHP,tp)