APACHE/NGINX/IIS/LIGHTTPD zblog PHP Program pseudo-static rules

Source: Internet
Author: User

Although the old Chiang tribe is built by WordPress, but to help customers corporate websites, as well as the usual toss more or zblog CMS, the former a little more users and plug-ins and themes and documents more, for a likely longer site or more appropriate, The only disadvantage is that the resources are relatively large. If we need to occupy the resources of lightweight CMS, personal comparisons recommend Zblog PHP or Typecho, both of which occupy a relatively small resource.

No matter which CMS we use to build the station, either choose to generate static, or use pseudo static URL, one user experience better, and then search engine experience is good. In general, we will use Nginx, Apache, IIS and other Web site environment, Zblog pseudo static rules are also commonly used, here old Chiang sorted to use the mainstream zblog PHP pseudo static rules.

First, Apache

<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritebase/
Rewritecond%{request_filename}!-f
Rewritecond%{request_filename}!-d
Rewriterule. /index.php [L]
</IfModule>
Copy the above to create the. htaccess file in the site root directory.

Second, Nginx

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;
}
Rename the file to the zblog.conf file and place it in the/usr/local/nginx/conf/directory and Add/modify the itbulu.com.conf file in the current site

include/usr/local/nginx/conf/zblog.conf;
Third, LIGHTTPD

# Rewrite Rules
Url.rewrite-if-not-file = (
"^/(zb_install|zb_system|zb_users)/(. *)" => "$",
"^/(. *.php)" => "$",
"^/(. *) $" => "/index.php/$0"
)
Add to the LIGHTTPD static rules in the host Control Panel, or modify/etc/lighttpd/lighttpd.conf to add the above rules.

Four, iis7-8

<?xml version= "1.0" encoding= "UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name= "/z-blogphp Imported Rule" stopprocessing= "true" >
<match url= "^.*" ignorecase= "false"/>
<conditions logicalgrouping= "Matchall" >
<add input= "{request_filename}" matchtype= "Isfile" negate= "true"/>
<add input= "{request_filename}" matchtype= "Isdirectory" negate= "true"/>
</conditions>
<action type= "Rewrite" Url= "index.php/{r:0}"/>
</rule>
<rule name= "/z-blogphp Imported rule index.php" stopprocessing= "true" >
<match url= "^index.php/.*" ignorecase= "false"/>
<conditions logicalgrouping= "Matchall" >
<add input= "{request_filename}" matchtype= "Isfile"/>
</conditions>
<action type= "Rewrite" Url= "index.php/{r:0}"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Create a Web.config file and copy the relevant content into it, or click the button to generate it.

V, IIS6

[Isapi_rewrite]
Rewriterule/page_ ([0-9]*) \.html/index\.php\?page=$1&rewrite=1 [i,l]
rewriterule/date-([0-9\-]+) (?: _)? ([0-9]*) \.html/index\.php\?date=$1&page=$2&rewrite=1 [i,l]
rewriterule/author-([0-9]+) (?: _)? ([0-9]*) \.html/index\.php\?auth=$1&page=$2&rewrite=1 [i,l]
rewriterule/tags-([0-9]+) (?: _)? ([0-9]*) \.html/index\.php\?tags=$1&page=$2&rewrite=1 [i,l]
Rewriterule/([^\./_]*) (?: _)? ([0-9]*) \.html/index\.php\?cate=$1&page=$2&rewrite=1 [i,l]
Rewriterule/([0-9]+) \.html (\?. *)? /index\.php\?id=$1&rewrite=1 [I,l]
Rewriterule/(?!) Zb_) (. +) \.html (\?.) *)? /index\.php\?alias=$1&rewrite=1 [I,l]
Create the Httpd.ini file in the root directory of the Web site and copy the relevant content into it, Httpd.ini file must be ANSI-encoded, or you can click the button to generate it.

Summary, according to our commonly used Web site environment installation and settings can be, the old Chiang this side of the use of a lot of nginx and Apache environment.

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.