- Apache/kangle (.htaccess)
这里带着自动转跳到https,如果不需要可以删除。
1<IfModule mod_rewrite.c>
2RewriteEngine On
3RewriteBase /
4RewriteCond %{REQUEST_FILENAME} !-f
5RewriteCond %{REQUEST_FILENAME} !-d
6RewriteRule ^(.*)$ /index.php/$1 [L]
7RewriteCond %{SERVER_PORT} !^443$
8RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
9</IfModule>
如果不是开启SSL访问,请删除以下代码
如果不带www访问到带www站点
- Nginx
- SEA
1name: taoblogs
2version: 1
3#cron:
4# - description: cron test
5# url: index.php
6# schedule: every 43 mins
7# timezone: Beijing
8handle:
9 - rewrite: if(!is_dir() && !is_file()) goto "index.php?%{QUERY_STRING}"
- IIS 下的 httpd.ini
不完美,自己看着修改
1[ISAPI_Rewrite]
2# 3600 = 1 hour
3CacheClockRate 3600
4RepeatLimit 32
5# 中文tag解决
6RewriteRule /tag/(.*) /index\.php\?tag=$1
7# sitemapxml
8RewriteRule /sitemap.xml /sitemap.xml [L]
9RewriteRule /favicon.ico /favicon.ico [L]
10# 内容页
11RewriteRule /(.*).html /index.php/$1.html [L]
12# 评论
13RewriteRule /(.*)/comment /index.php/$1/comment [L]
14# 分类页
15RewriteRule /category/(.*) /index.php/category/$1 [L]
16# 分页
17RewriteRule /page/(.*) /index.php/page/$1 [L]
18# 搜索页
19RewriteRule /search/(.*) /index.php/search/$1 [L]
20# feed
21RewriteRule /feed/(.*) /index.php/feed/$1 [L]
22# 日期归档
23RewriteRule /2(.*) /index.php/2$1 [L]
24# 上传图片等
25RewriteRule /action(.*) /index.php/action$1 [L]
##注:记得到后台永久链接设置里,启用地址重写功能