Typecho 的伪静态规则

·
Typecho no tag October 12, 2018
!本文可能 超过2年没有更新,今后内容也许不会被维护或者支持,部分内容可能具有时效性,涉及技术细节或者软件使用方面,本文不保证相应的技术更新和实践可操作性。

仅包含Apache和Nginx伪静态规则

Apache

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</IfModule>

Nginx

location / {
index index.html index.php;
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php) {
rewrite (.*) $1/index.php;
}
if (!-f $request_filename) {
rewrite (.*) /index.php;
}
}

注:代码仅供参考,如有问题请自行查询官方。


首次创建时间:2018-10-12 23:38:00
最后修改时间:2018-10-12 23:39:28

  • 习惯wp再用typecho感觉编辑器很简洁
  • 小时了了 大未必佳

_(:3 」∠)_
(抱歉)
自发布之日起超123天后自动关闭评论哦!


© 2025 Mr.Cui's Blog. Using Typecho & Moricolor.

鲁ICP备16004095号-2
鲁公网安备37028502250699号
HTTP/3 IPv6