3. Actual operation:
Example: Rewriteengine on
Rewritecond%{http_user_agent} ^msie [Nc,or]
Rewritecond%{http_user_agent} ^opera [NC]
Rewriterule ^.*-[f,l] here "-" means no replacement, the browser for IE and opera visitors will be banned from access.
Example:
Rewriteengine on
Rewritebase/test
Rewritecond%{request_filename}.php-f
Rewriterule ([^/]+) $/test/$1.php
#for Example:/test/admin =/test/admin.php
Rewriterule ([^/]+) \.html$/test/$1.php [L]
#for Example:/test/admin.html =/test/admin.php
Restrict a catalog to display only pictures
< Ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{request_filename}!^.*\. (gif|jpg|jpeg|png|swf) $
Rewriterule. *$-[f,l]
</ifmodule>
In httpd-vhosts.conf, the following is the wording:
Rewriterule ^/world/([\d]+) _ ([a-z]+). html$/world/index.php?c=world&a=housedetail&houseid={$1}& HOUSETYPE={$2} [L]
Rewriterule ^/pinggu/([a-z]+)/([0-9]+). html/pinggu/index.php?c=pinggu&a=detail&city=$1&newcode=$2 &rewrite=1 [Nc,ne]
Rewriterule ^/jiaju/([a-z]+)/jc_c ([\d]+). html/jiaju/index.php?c=jiaju&a=buildlist&city=$1&cid=$2
Rewriterule ^/esf_bs/([a-z]*) _? (\d*) _?b? (\d*)/?m? ([0-9,]*) x? (\d*) A? ([0-9,]*) c? (\d*) p? ([0-9,]*) d? (\d*)/$/esf/index.php?purpose=%b1%f0%cafb&city=$1&district=$2&comarea=$3&price=$4&orderby= $5&area=$6&tags=$7&buildclass=$8&equipment=$9&rewrite
Rewriterule ^/world/([\d]+) _ ([a-z]+). html$/world/index.php?c=world&a=housedetail&houseid={$1}& HOUSETYPE={$2} [L]
#住宅rewrite规则
rewriterule^/zf/([a-z]*) _? (\d*) _? (\d*)/?p? (\d*) H? (\d*) m? (\d*) c? (\d*) ([a-z0-9]*)/$ $8&&purpose=&city=$1&district=$2&comarea=$3&price=$4&room=$5& rtype=$6&tags=$7 [C,NC]
Rewriterule^s? (\d*) r? (\d*) O? (\d*) F? (\d*) d? (\d*) p?x? (\d*) && (. *)/zf/index.php?$7&housetype=$1&railway=$2&towards=$3&floor=$4&equipment= $5&orderby=$6&rewrite [QSA,L,NC]
#别墅rewrite规则
Rewriterule ^/zf_bs/([a-z]*) _? (\d*) _? (\d*)/?p? (\d*) T? (\d*) m? (\d*) s? (\d*) ([a-z0-9]*)/?$ $8&&purpose=%b1%f0%ca%fb&city=$1&district=$2&comarea=$3&price=$4& buildclass=$5&rtype=$6&housetype=$7 [C,NC]
Rewriterule ^h? (\d*) O? (\d*) F? (\d*) d? (\d*) p?x? (\d*) && (. *)/zf/index.php?$6&room=$1&towards=$2&floor=$3&equipment=$4&orderby=$5 &rewrite [QSA,L,NC]
#写字楼rewrite规则
Rewriterule ^/zf_app_xzl/([a-z]*) _? (\d*) _? (\d*)/?p? (\d*) A? (\d*) T? (\d*) c? (\d*) r? (\d*)/? /zf/index.php?purpose=%d0%b4%d7%d6%c2%a5&app_type=app&city=$1&district=$2&comarea=$3&price =$4&area=$5&propertysubtype=$6&tags=$7&&railway=$8&rewrite [QSA,L]
#写字楼rewrite规则
Rewriterule ^/zf_xzl/([a-z]*) _? (\d*) _? (\d*)/?p? (\d*) A? (\d*) T? (\d*) c? (\d*) r? (\d*)/? /zf/index.php?purpose=%d0%b4%d7%d6%c2%a5&city=$1&district=$2&comarea=$3&price=$4&area=$5 &propertysubtype=$6&tags=$7&&railway=$8&rewrite [Qsa,l]
#写字楼rewrite规则
Rewriterule ^/zf_xzl/([a-z]*) _? (\d*) _? (\d*)/?p? (\d*) A? (\d*) T? (\d*) c? (\d*) r? (\d*)/? /zf/index.php?purpose=%d0%b4%d7%d6%c2%a5&city=$1&district=$2&comarea=$3&price=$4&area=$5 &propertysubtype=$6&tags=$7&&railway=$8&rewrite [Qsa,l]
Rewriterule ^/zf/([a-z]+) _XM ([0-9]+]/$/zf/index.php?c=zf&a=index&city=$1&projcodes=$2&src= Xiaoqu&rewrite [L]