Description of pseudo-static rules of Typecho programs (including Linux/Windows)

Source: Internet
Author: User

Although the old left blog is a Wordpress program, I have to say that the wp program is even one of the great programs, but the resource occupation problems are still relatively poor. If you have used the WP program to create a blog, you should know that when the website traffic reaches hundreds of times, the average host CPU will exceed the threshold, and even the host will be suspended. Generally, the CPU limit of host products is 5-10%, so it is easy to exceed the standard. The Typecho blog program is developed by Chinese people. Although it is not updated yet, its functions are basically complete. The structure is similar to WORDPRESS, but it is much better than WP in resource occupation. Therefore, there are many Typecho users.

The pseudo-static rules of Typecho programs are different from those of wp which are available by default. They can only take effect after being manually loaded into space. The following describes the pseudo-static rules of this program in different host environments. I hope it will be helpful to you.

1. Linux Apache environment (. htaccess ):
Copy codeThe Code is as follows: <IfModule mod_rewrite.c>
RewriteEngine On
# The following is the root directory. The directory must be modified, for example,/laozuo/
RewriteBase/
RewriteCond % {REQUEST_FILENAME }! -F
RewriteCond % {REQUEST_FILENAME }! -D
RewriteRule ^ (. *) $/index. php/$1 [L]

# Skip without www
RewriteCond % {HTTP_HOST} ^ www.laozuo.org
RewriteRule (. *) http://laozuo.org/#1 [R = 301, L]

# Skip to bring without www
RewriteCond % {HTTP_HOST} ^ laozuo.org
RewriteRule (. *) http://www.laozuo.org/#1 [R = 301, L]
</IfModule>

2. Linux Apache environment (Nginx ):
Copy codeThe Code is as follows: 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 ):
Copy codeThe Code is as follows: [ISAPI_Rewrite]
#3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Chinese tag Solution
RewriteRule/tag/(. *)/index \. php \? Tag = $1
# Sitemapxml
RewriteRule/sitemap. xml/sitemap. xml [L]
RewriteRule/favicon. ico/favicon. ico [L]
# Content Page
RewriteRule/(. * example .html/index. php/example 1.html [L]
# Comment
RewriteRule/(. *)/comment/index. php/$1/comment [L]
# Category page
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 Archiving
RewriteRule/2 (. *)/index. php/2 $1 [L]
# Uploading images
RewriteRule/action (. *)/index. php/action $1 [L]

Because there is only apache space on the left, there is no problem in the test. You can test it in other environments. If you have any problems, leave me a message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.