这里带着自动转跳到https,如果不需要可以删除。

PLAINTEXT
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
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>
点击展开查看更多

如果不是开启SSL访问,请删除以下代码

PLAINTEXT
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
点击展开查看更多

如果不带www访问到带www站点

PLAINTEXT
RewriteCond %{HTTP_HOST} ^jinjun.top
RewriteRule (.*) https://img.boke.fun/images/$1 [R=301,L]
点击展开查看更多
PLAINTEXT
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
点击展开查看更多
PLAINTEXT
name: taoblogs
version: 1
#cron:
# - description: cron test
# url: index.php
# schedule: every 43 mins
# timezone: Beijing
handle:
 - rewrite: if(!is_dir() && !is_file()) goto "index.php?%{QUERY_STRING}"
点击展开查看更多

不完美,自己看着修改

PLAINTEXT
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# 中文tag解决
RewriteRule /tag/(.*) /index\.php\?tag=$1
# sitemapxml
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# 内容页
RewriteRule /(.*).html /index.php/$1.html [L]
# 评论
RewriteRule /(.*)/comment /index.php/$1/comment [L]
# 分类页
RewriteRule /category/(.*) /index.php/category/$1 [L]
# 分页
RewriteRule /page/(.*) /index.php/page/$1 [L]
# 搜索页
RewriteRule /search/(.*) /index.php/search/$1 [L]
# feed
RewriteRule /feed/(.*) /index.php/feed/$1 [L]
# 日期归档
RewriteRule /2(.*) /index.php/2$1 [L]
# 上传图片等
RewriteRule /action(.*) /index.php/action$1 [L]
点击展开查看更多

##注:记得到后台永久链接设置里,启用地址重写功能

版权声明

作者: JunYan`Blog

链接: https://www.jinjun.top/posts/10c6/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

评论

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键