Typecho和WordPress程序的伪静态规则

421 0

  日常我们常见的建站环境是LNMP或者LAMP,Typecho和WordPress是日常使用比较多的博客程序,今天这篇文章主要记录一下Nginx和Apache环境下的伪静态规则,不涉及详细配置教程,如有疑问可以留言讨论。

Typecho

Nginx

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

Apache

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

WordPress

Nginx

location /
{
try_files $uri $uri/ /index.php?$args;
}
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>
最后更新 2022-06-12
评论 ( 0 )
OωO
隐私评论