-
Cuando cambiamos del servidor Apache al servidor Nginx, sus reglas pseudoestáticas son diferentes, por lo que si está familiarizado con las reglas pseudoestáticas del servidor Nginx, por supuesto es una buena idea escribirlas usted mismo. Sin embargo, muchos internautas todavía no saben mucho sobre las reglas pseudoestáticas del servidor Nginx. Si instala algunos programas de uso común, como WordPress, phpCMS, ECSHOP, SHOPEX y Discuz 7, entonces las reglas pseudoestáticas son. ya disponible. Para comodidad de los webmasters, hemos recopilado reglas pseudoestáticas para estos programas de uso común.
Reglas pseudoestáticas de WordPress
ubicación/{
índice index.html index.php;
if (-f $nombre_archivo_solicitud/index.html){
reescribir (.*) $1/index.html descanso;
}
if (-f $nombre_archivo_solicitud/index.php){
reescribir (.*) $1/index.php;
}
if (!-f $nombre_archivo_solicitud){
reescribir (.*) /index.php;
}
}
Reglas pseudoestáticas de PHPCMS
ubicación/{
### Las siguientes son reglas de reescritura pseudoestática de PHPCMS
reescribir ^(.*)show-([0-9]+)-([0-9]+).html$ $1/show.php?itemid=$2&page=$3;
reescribir ^(.*)list-([0-9]+)-([0-9]+).html$ $1/list.php?catid=$2&page=$3;
reescribir ^(.*)show-([0-9]+).html$ $1/show.php?specialid=$2;
####Las siguientes son reglas de reescritura pseudoestática de PHPWind
reescribe ^(.*)-htm-(.*)$ $1.php?$2 al final;
reescribir ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2 último;
}
Reglas pseudoestáticas de ECSHOP
if (!-e $nombre_archivo_solicitud)
{
reescribe "^/index.html" /index.php al final;
reescribe "^/categoría$" /index.php al final;
reescriba "^/feed-c([0-9]+).xml$" /feed.php?cat=$1 al final;
reescriba “^/feed-b([0-9]+).xml$” /feed.php?brand=$1 al final;
reescribe “^/feed.xml$” /feed.php al final;
reescribe “^/categoría-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^- ]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /category.php?id=$1&brand=$2&price_min= $3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 último;
reescribe “^/categoría-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^- ]*)(.*).html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 último;
reescribe “^/categoría-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)( .*).html$” /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 último;
reescribe “^/categoría-([0-9]+)-b([0-9]+)-([0-9]+)(.*).html$” /category.php?id=$1 &brand=$2&page=$3 último;
reescriba “^/category-([0-9]+)-b([0-9]+)(.*).html$” /category.php?id=$1&brand=$2 último;
reescriba “^/category-([0-9]+)(.*).html$” /category.php?id=$1 al final;
reescriba “^/goods-([0-9]+)(.*).html” /goods.php?id=$1 al final;
reescribe “^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /article_cat .php?id=$1&page=$2&sort=$3&order=$4 último;
reescriba “^/article_cat-([0-9]+)-([0-9]+)(.*).html$” /article_cat.php?id=$1&page=$2 último;
reescriba “^/article_cat-([0-9]+)(.*).html$” /article_cat.php?id=$1 por último;
reescriba “^/article-([0-9]+)(.*).html$” /article.php?id=$1 al final;
reescribe “^/marca-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+) .html” /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 último;
reescribe “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*).html” /brand.php?id=$1&cat =$2&page=$3 último;
reescriba “^/brand-([0-9]+)-c([0-9]+)(.*).html” /brand.php?id=$1&cat=$2 último;
reescriba “^/brand-([0-9]+)(.*).html” /brand.php?id=$1 al final;
reescriba “^/tag-(.*).html” /search.php?keywords=$1 al final;
reescriba “^/snatch-([0-9]+).html$” /snatch.php?id=$1 al final;
reescriba “^/group_buy-([0-9]+).html$” /group_buy.php?act=view&id=$1 por último;
reescriba “^/auction-([0-9]+).html$” /auction.php?act=view&id=$1 por último;
reescriba “^/exchange-id([0-9]+)(.*).html$” /exchange.php?id=$1&act=ver último;
reescribe “^/intercambio-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-( [a-zA-Z]+)(.*).html$” /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 último;
reescribir ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /exchange. php?cat_id=$1&page=$2&sort=$3&order=$4 último;
reescriba “^/exchange-([0-9]+)-([0-9]+)(.*).html$” /exchange.php?cat_id=$1&page=$2 último;
reescriba “^/exchange-([0-9]+)(.*).html$” /exchange.php?cat_id=$1 por último;
}
Reglas pseudoestáticas de SHOPEX
ubicación/{
if (!-e $nombre_archivo_solicitud) {
reescribir ^/(.+.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 último;
}
}
Discuz 7 reglas pseudoestáticas
reescribir ^/archiver/((fid|tid)-[w-]+.html)$ /archiver/index.php?$1 último;
reescribir ^/forum-([0-9]+)-([0-9]+).html$ /forumdisplay.php?fid=$1&page=$2 último;
reescribir ^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ /viewthread.php?tid=$1&extra=page%3D$3 &page=$2 último;
reescribir ^/space-(nombre de usuario|uid)-(.+).html$ /space.php?$1=$2 último;
reescribe ^/tag-(.+).html$ /tag.php?name=$1 al final;
Autor: Zhu Maohai
Fuente del artículo: blog de Zhu Maohai