18693137663
2137087126@qq.com

技术动态

联系我们

泽熙科技

蒋经理 18693137663
2137087126@qq.com
QQ:2137087126
微信:clyjiangxi

常用的伪静态集合

2022年04月16日

Thinkphp伪静态规则

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>


WordPress伪静态规则

nginx:


location / {

  try_files $uri $uri/ /index.php?$args;

}


# Add trailing slash to */wp-admin requests.

rewrite /wp-admin$ $scheme://$host$uri/ permanent;


apache:


<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>


laravel8伪静态规则

nginx:

location / {

                # First attempt to serve request as file, then

                # as directory, then fall back to displaying a 404.

                # try_files $uri $uri/ =404;

                try_files $uri $uri/ /index.php?$query_string;

}