2014年3月:测试

© ㄒiger / Posted in 程序代码 / March 7, 2014

apache 伪静态规则

RewriteEngine On

RewriteRule ^([a-zA-Z]+)\.(jpg|gif|png|wbmp)$ controller/Resizer.php?m=original&a=$1&e=$2 [L]
RewriteRule ^(icon|small|medium|square)\/([a-zA-Z]+)\.(jpg|gif|png|wbmp)$ controller/Resizer.php?m=$1&a=$2&e=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule (.*) application.php?request=$1 [L,QSA]

nginx 伪静态规则

rewrite ^/([a-zA-Z]+).(jpg|gif|png|wbmp)$ /controller/Resizer.php?m=original&a=$1&e=$2 last;
 rewrite ^/(icon|small|medium|square)/([a-zA-Z]+).(jpg|gif|png|wbmp)$ /controller/Resizer.php?m=$1&a=$2&e=$3 last;
 if (!-f $request_filename){
  set $rule_2 1$rule_2;
 }
 if ($rule_2 = "1"){
  rewrite /(.*) /application.php?request=$1 last;
 }


  • 分页: