Blogger Information
Blog 64
fans 6
comment 2
visits 82806
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
thinkphp 伪静态
王娇
Original
6207 people have browsed it
  • 伪静态就是在访问url时隐藏index.php
    例:

http://api.xuanransoftware.com/index.php/admins/login/login

http://api.xuanransoftware.com/admins/login/login

nginx

  • 根目录下新建.rewrite.conf文件
  1. location / {
  2. if (!-e $request_filename){
  3. rewrite ^(.*)$ /index.php?s=$1 last; break;
  4. }
  5. }

Apache

  • 根目录新建文件.htaccess
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine on
  3. RewriteBase /
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteCond %{REQUEST_FILENAME} !-f
  6. RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
  7. </IfModule>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post