Typecho program pseudo static rules of includes Linux and Windows
- 2020-05-06 12:07:47
- OfStack
Although the old left blog USES the Wordpress program, I have to say that even though the wp program is one of the best, it has a poor resource footprint. If you've ever used the WP program to build a blog, you should know that the average host CPU will exceed the limit or even be suspended when the site reaches a few hundred page views. Because the general host product CPU is limited to 5-10%, it is easy to exceed the standard. Typecho blog program is developed by Chinese people. Although it is not updated at present, its function is basically perfect. Its structure is similar to WORDPRESS, but it is much better than WP in terms of occupying resources. So Typecho still has a lot of users.
The pseudo-static rules of the Typecho program are not directly available by default, as wp is, and need to be manually loaded into the space to take effect. The following old left sorted out the program in different host environment in the pseudo-static rules, I hope to help you.
1, Linux Apache environment (.htaccess) :
2, Linux Apache environment (Nginx) :
3, Windows IIS pseudo-static (httpd.ini) :
Because old zuo only has apache space, there is no problem in the test. In other environments, there are friends who can test. If there is any problem, please leave me a message.
The pseudo-static rules of the Typecho program are not directly available by default, as wp is, and need to be manually loaded into the space to take effect. The following old left sorted out the program in different host environment in the pseudo-static rules, I hope to help you.
1, Linux Apache environment (.htaccess) :
<IfModule mod_rewrite.c>
RewriteEngine On
# Below is the root directory, the folder to modify the path, such as /laozuo/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# with www To jump to without
RewriteCond %{HTTP_HOST} ^www.laozuo.org
RewriteRule (.*) http://laozuo.org/$1 [R=301,L]
# Don't take www Jump to tape
RewriteCond %{HTTP_HOST} ^laozuo.org
RewriteRule (.*) http://www.laozuo.org/$1 [R=301,L]
</IfModule>
2, Linux Apache environment (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;
}
}
3, Windows IIS pseudo-static (httpd.ini) :
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Chinese tag To solve
RewriteRule /tag/(.*) /index\.php\?tag=$1
# sitemapxml
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# Content page
RewriteRule /(.*).html /index.php/$1.html [L]
# comments
RewriteRule /(.*)/comment /index.php/$1/comment [L]
# Category pages
RewriteRule /category/(.*) /index.php/category/$1 [L]
# paging
RewriteRule /page/(.*) /index.php/page/$1 [L]
# Search page
RewriteRule /search/(.*) /index.php/search/$1 [L]
# feed
RewriteRule /feed/(.*) /index.php/feed/$1 [L]
# Date of filing
RewriteRule /2(.*) /index.php/2$1 [L]
# Upload pictures, etc.
RewriteRule /action(.*) /index.php/action$1 [L]
Because old zuo only has apache space, there is no problem in the test. In other environments, there are friends who can test. If there is any problem, please leave me a message.