Focus on cloud service provider activities
Notes on website operation and maintenance

Complete set of pseudo static rules for Typecho programs (Linux/Windows)

Although Laozuo's blog is a Wordpress program, I have to say that even though the wp program is one of the best programs, it still has a poor resource utilization problem. If you have used the WP program to build a blog, you should know that when the number of website visits reaches hundreds, the general host CPU will exceed the standard, or even the host will be suspended. Because the CPU limit of general host products is 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 functions are basically perfect. Its structure is similar to WORDPRESS, but it occupies much better resources than WP. So there are still many Typecho users.

The pseudo static rules of Typecho program are different from those of wp, which are available directly by default. We need to manually load them into the space to take effect. Lao Zuo has sorted out the pseudo static rules of this program in different host environments, hoping to help you.

1. LinuxApache environment (. htaccess):

<IfModule mod_rewrite.c>
RewriteEngine On
#The following is the path to be modified in the root directory, such as/laozuo/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} ! -f
RewriteCond %{REQUEST_FILENAME} ! -d
RewriteRule ^(.*)$ /index.php/$1 [L]

#Jump from www to non www
RewriteCond %{HTTP_HOST} ^www.laozuo.org
RewriteRule (.*) http://laozuo.org/ $1 [R=301,L]

#Jump from without www to with www
RewriteCond %{HTTP_HOST} ^laozuo.org
RewriteRule (.*) https://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 resolution
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 Page
RewriteRule /category/(.*) /index.php/category/$1 [L] #Pagination
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 filing
RewriteRule /2(.*) /index.php/2$1 [L] #Upload pictures, etc
RewriteRule /action(.*) /index.php/action$1 [L]

Because Lao Zuo only has Apache space, there is no problem in testing. Other environments have friends who can test. If you encounter problems, you can leave a message for me.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Complete set of pseudo static rules for Typecho programs (Linux/Windows)