typecho虚拟主机开启伪静态.htaccess规则

typecho虚拟主机开启伪静态.htaccess规则

川汉子
2020-12-29 / 0 评论 / 552 阅读 / 正在检测是否收录...

如题,typecho伪静态.htaccess规则,

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

http跳转https的.htaccess规则

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

# 不带 www 的跳转到https(删除这排)
RewriteCond %{HTTP_HOST} ^chuanhanzi.cn
RewriteRule (.*) https://chuanhanzi.cn/$1 [R=301,L]

# 带 www 的跳转到https的(删除这排)
RewriteCond %{HTTP_HOST} ^www.chuanhanzi.cn
RewriteRule (.*) https://www.chuanhanzi.cn/$1 [R=301,L]
</IfModule>
0

评论 (0)

取消