Destoon URL Rewrite (pseudo static) Setup method _php Instance

Source: Internet
Author: User

1, if your server supports. htaccess, you do not need to set , the. htaccess in the root directory of the Web site has set the rules. The
Rule (reference http://download.destoon.com/rewrite/htaccess.txt)

# Destoon business-to-business Rewrite Rules errordocument 404/404.php rewriteengine on Rewritebase/rewriterule ^ (. *) \. (ASP|ASPX|ASA|ASAX|DLL|JSP|CGI|FCGI|PL) (. *) $/404.php rewriterule ^ (. *)/file/(. *) \.php (. *) $/404.php rewriterule ^ (. *)-htm-(. *) $ $1.php?$2 rewriterule ^ (. *)/ show-([0-9]+) ([\-])? ([0-9]+) \.html$ $1/show.php?itemid=$2&page=$4 rewriterule ^ (. *)/list-([0-9]+) ([\-])? ([0-9]+) \.html$ $1/list.php?catid=$2&page=$4 rewriterule ^ (. *)/show/([0-9]+)/([0-9]+)? ([/]) $ $1/show.php?itemid=$2&page=$3 rewriterule ^ (. *)/list/([0-9]+)/([0-9]+)? ([/]) $ $1/list.php?catid=$2&page=$3 rewriterule ^ (. *)/([a-za-z0-9_\-]+)-C ([0-9]+)-([0-9]+) \.html$ $1/list.php ? catid=$3&page=$4 rewriterule ^ (. *)/([a-z]+)/(. *) \.shtml$ $1/$2/index.php?rewrite=$3 rewriterule ^ (COM)/([ a-z0-9_\-]+)/([a-z]+)/(. *) \.html$ index.php?homepage=$2&file=$3&rewrite=$4 rewriterule ^ (COM)/([a-z0-9_\- ]+)/([a-z]+) ([/]) $ index.php?homepage=$2&file=$3 rewriterule ^ (COM)/([a-z0-9_\-]+) ([/]) $ index.php?homepage= $

2, if the Apache server :

Users of Apache 1.x please check the conf/httpd.conf for the following two pieces of code:

LoadModule rewrite_module  libexec/mod_rewrite.so
addmodule mod_rewrite.c

Apache 2.x users check to see if the following code exists in the conf/httpd.conf:

LoadModule Rewrite_module  modules/mod_rewrite.so

If it exists and begins with a #, delete #. The following code is then added to the configuration file (usually conf/httpd.conf or conf/extra/httpd-vhosts.conf).
It is important to note that if the site is defined by a virtual host, it must be added to the virtual host configuration, that is, <VirtualHost>, if added outside the virtual host configuration will probably not be available. Change and then restart Apache.

Apache conf file configuration (reference Http://download.destoon.com/rewrite/apache.txt) Rules:

# Destoon business-to-business Rewrite Rules errordocument 404/404.php rewriteengine on Rewritebase/rewriterule ^ (. *) \. (ASP|ASPX|ASA|ASAX|DLL|JSP|CGI|FCGI|PL) (. *) $/404.php rewriterule ^ (. *)/file/(. *) \.php (. *) $/404.php rewriterule ^ (. *)-htm-(. *) $ $1.php?$2 rewriterule ^ (. *)/ show-([0-9]+) ([\-])? ([0-9]+) \.html$ $1/show.php?itemid=$2&page=$4 rewriterule ^ (. *)/list-([0-9]+) ([\-])? ([0-9]+) \.html$ $1/list.php?catid=$2&page=$4 rewriterule ^ (. *)/show/([0-9]+)/([0-9]+)? ([/]) $ $1/show.php?itemid=$2&page=$3 rewriterule ^ (. *)/list/([0-9]+)/([0-9]+)? ([/]) $ $1/list.php?catid=$2&page=$3 rewriterule ^ (. *)/([a-za-z0-9_\-]+)-C ([0-9]+)-([0-9]+) \.html$ $1/list.php Catid=$3&page=$4 rewriterule ^ (. *)/([a-z]+)/(. *) \.shtml$ $1/$2/index.php?rewrite=$3 rewriterule ^ (. *)/com/([ a-z0-9_\-]+)/([a-z]+)/(. *) \.html$ $1/index.php?homepage=$2&file=$3&rewrite=$4 rewriterule ^ (. *)/com/([ a-z0-9_\-]+)/([a-z]+) ([/]) $ $1/index.php?homepage=$2&file=$3 rewriterule ^ (. *)/com/([a-z0-9_\-]+) ([/]) $ $1/ IndeX.php?homepage=$2 

3, Nginx rule (Reference http://download.destoon.com/rewrite/nginx.txt):

 rewrite ^/(. *) \. (ASP|ASPX|ASA|ASAX|DLL|JSP|CGI|FCGI|PL)
(. *) $/404.php last;
Rewrite ^/(. *)/file/(. *) \.php (. *) $/404.php last;
Rewrite ^/(. *)-htm-(. *) $/$1.php?$2 last; Rewrite ^/(. *)/show-([0-9]+) ([\-])?
([0-9]+) \.html$/$1/show.php?itemid=$2&page=$4 last; Rewrite ^/(. *)/list-([0-9]+) ([\-])?
([0-9]+) \.html$/$1/list.php?catid=$2&page=$4 last; Rewrite ^/(. *)/show/([0-9]+)/([0-9]+)?
([/]) $/$1/show.php?itemid=$2&page=$3 last; Rewrite ^/(. *)/list/([0-9]+)/([0-9]+)?
([/]) $/$1/list.php?catid=$2&page=$3 last;
Rewrite ^/(. *)/([a-za-z0-9_\-]+)-C ([0-9]+)-([0-9]+) \.html$/$1/list.php?catid=$3&page=$4 last;
Rewrite ^ (. *)/([a-z]+)/(. *) \.shtml$ $1/$2/index.php?rewrite=$3 last;
Rewrite ^/(COM)/([a-z0-9_\-]+)/([a-z]+)/(. *) \.html$/index.php?homepage=$2&file=$3&rewrite=$4;
Rewrite ^/(COM)/([a-z0-9_\-]+)/([a-z]+) ([/]) $/index.php?homepage=$2&file=$3 last; Rewrite ^/(COM)/([a-z0-9_\-]+) ([/]) $/index.php?homepage=$2 last; 

4, Zeus Rule (Reference http://download.destoon.com/rewrite/zeus.txt):

Match URL into $ with ^ (. *) \. (ASP|ASPX|ASA|ASAX|DLL|JSP|CGI|FCGI|PL) (. *) $ if matched then set url =/404.php endif match URL into $ with ^ (. *)/file/(. *) \.php (. *) $ if matched then set U RL =/404.php endif match URL into $ with ^ (. *)-htm-(. *) $ if matched then set url = $1.php?$2 endif match URL into $ w ith ^ (. *)/show-([0-9]+) ([\-])? ([0-9]+)? \.html$ if matched then set url = $1/show.php?itemid=$2&page=$4 endif match URL into $ with ^ (. *)/list-([ 0-9]+) ([\-])? ([0-9]+)? \.html$ if matched then set url = $1/list.php?catid=$2&page=$4 endif match URL into $ with ^ (. *)/show/([0 -9]+)/([0-9]+)? ([/])? $ if matched then set url = $1/show.php?itemid=$2&page=$3 endif match URL into $ with ^ (. *)/list/([0-9]+)/([ 0-9]+)? ([/])? $ if matched then set url = $1/list.php?catid=$2&page=$3 endif match URL into $ with ^ (. *)/([a-za-z0-9_\-]+) -C ([0-9]+)-([0-9]+) \.html$ if matched then set url = $1/list.php?catid=$3&page=$4 endif match URL into $ with ^ (. *)/ ([a-z]+)/(. *) \.shtml$ if matched then set url = $1/$2/index.php?rewrite=$3 endif match URL into $ with ^ (. *)/com/([a-z0-9_\-]+)/([ a-z]+)/(. *) \.html$ If matched then set url = $1/index.php?homepage=$2&file=$3&rewrite=$4 endif match URL into $ with ^ (. *)/com/([a-z0-9_\-]+)/([a-z]+) ([/])? $ if matched then set URL = $1/index.php?homepage=$2&file=$3 endif m Atch URL into $ with ^ (. *)/com/([a-z0-9_\-]+) ([/])? $ if matched then set URL = $1/index.php?homepage=$2 endif

5, IIS6 Server

Please download Http://download.destoon.com/rewrite/IIS_Rewrite.zip
The rules have been set up to operate on the Readme.txt file contents.
If your Web site supports Httpd.ini files, use the following rules (refer to Http://download.destoon.com/rewrite/httpd.ini):

[Isapi_rewrite] # Destoon business-to-business www.destoon.com # 3600 = 1 hour cacheclockrate 3600 Repeatlimit # Protect Httpd.ini D httpd.parse.errors files # from accessing through HTTP rewriterule ^ (. *) \. (ASP|ASPX|ASA|ASAX|DLL|JSP|CGI|FCGI|PL) (. *) $/404\.php rewriterule ^ (. *)/file/(. *) \.php (. *) $/404\.php rewriterule ^ (. *)-htm-(. *) $ $1\.php\?$2 rewriterule ^ (. *)/show-([0-9]+) ([\-])? ([0-9]+) \.html$ $1/show\.php\?itemid=$2&page=$4 rewriterule ^ (. *)/list-([0-9]+) ([\-])? ([0-9]+) \.html$ $1/list\.php\?catid=$2&page=$4 rewriterule ^ (. *)/show/([0-9]+)/([0-9]+)? ([/]) $ $1/show\.php\?itemid=$2&page=$3 rewriterule ^ (. *)/list/([0-9]+)/([0-9]+)? ([/]) $ $1/list\.php\?catid=$2&page=$3 rewriterule ^ (. *)/([a-za-z0-9_\-]+)-C ([0-9]+)-([0-9]+) \.html$ $1/list\. Php\?catid=$3&page=$4 rewriterule ^ (. *)/com/([a-z0-9_\-]+)/([a-z]+)/(. *) \.html$ $1/index\.php\?homepage=$2 &file=$3&rewrite=$4 rewriterule ^ (. *)/com/([a-z0-9_\-]+)/([a-z]+) ([/]) $ $1/index\.php\?homepage=$2& File=$3 RewriterUle ^ (. *)/com/([a-z0-9_\-]+) ([/]) $ $1/index\.php\?homepage=$2 rewriterule ^ (. *)/([a-z]+)/(. *) \.shtml$ $1/$2/index\ . php\?rewrite=$3

6, IIS7 Server

The rules (reference http://download.destoon.com/rewrite/web.config.txt) are:

<?xml version= "1.0" encoding= "UTF-8"?> <configuration> <system.webServer> <rewrite> <rule s> <rule name= "Destoon_rewrite_0" > <match url= "^ (. *) \. (ASP|ASPX|ASA|ASAX|DLL|JSP|CGI|FCGI|PL) (. *) $ "/> <action type=" Rewrite "url="/404.php "/> </rule> <rule name=" Destoon_rewrite_1 "&
      Gt
    <match url= "^ (. *)/file/(. *) \.php (. *) $"/> <action type= "Rewrite" url= "/404.php"/> </rule> <rule name= "destoon_rewrite_2" > <match url= "^ (. *)-htm-(. *) $"/> <action type= "rewrite" url= "{R : 1}.php? {r:2} "/> </rule> <rule name=" Destoon_rewrite_3 "> <match url=" ^ (. *)/show-([0-9]+) ([\-])? ([0-9]+)? \.html$ "/> <action type=" Rewrite "url=" {r:1}/show.php?itemid={r:2}&page={r:4} "/> </rul e> <rule name= "Destoon_rewrite_4" > <match url= "^ (. *)/list-([0-9]+) ([\-])? ([0-9]+) \.html$ "/> <action typE= "Rewrite" url= "{r:1}/list.php?catid={r:2}&page={r:4}"/> </rule> <rule name= "Destoon_rewrite_5" &
     Gt <match url= "^ (. *)/show/([0-9]+)/([0-9]+)?
    ([/])? $ "/> <action type=" Rewrite "url=" {r:1}/show.php?itemid={r:2}&page={r:3} "/> </rule> <rule name= "Destoon_rewrite_6" > <match url= "^ (. *)/list/([0-9]+)/([0-9]+)?
    ([/])? $ "/> <action type=" Rewrite "url=" {r:1}/list.php?catid={r:2}&page={r:3} "/> </rule> <rule name= "Destoon_rewrite_7" > <match url= "^ (. *)/([a-za-z0-9_\-]+)-C ([0-9]+)-([0-9]+) \.html$"/> &L T;action type= "Rewrite" url= "{r:1}/list.php?catid={r:3}&page={r:4}"/> </rule> <rule name= "Destoon _rewrite_8 "> <match url=" ^ (COM)/([a-z0-9_\-]+)/([a-z]+)/(. *) \.html$ "/> <action type=" rewrite "url=" Index.php?homepage={r:2}&file={r:3}&rewrite={r:4} "/> </rule> <rule name=" Destoon_rewrite_9 "&G
  T   <match url= "^ (COM)/([a-z0-9_\-]+)/([a-z]+) ([/])" $ "/> <action type=" Rewrite "url=" Index.php?homepage={r:2 }&file={r:3} "/> </rule> <rule name=" destoon_rewrite_10 "> <match url=" ^ (COM)/([a-z0-9_\ -]+) ([/])? $ "/> <action type=" Rewrite "Url=" Index.php?homepage={r:2} "/> </rule> <rule Name = "Destoon_rewrite_11" > <match url= "^ ([a-z]+)/(. *) \.shtml$"/> <action type= "rewrite" url= "{r:1}/in Dex.php?rewrite={r:2} "/> </rule> </rules> </rewrite> </system.webServer> </conf Iguration>


Rewrite after the entry into force, please in the site background = "Website settings =" SEO optimization = "URL Rewrite, select" Open "Submit .

Then enter the modules of the module set "SEO Settings" to select the corresponding pseudo static address rules

Select "Update Address" to submit.

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.