这条apache下的伪静态规则改成nginx下的怎样写? 5
这条apache下的伪静态规则改成nginx下的怎样写?谢谢!------------------------------------------------------...
这条apache下的伪静态规则改成nginx下的怎样写?谢谢!
--------------------------------------------------------
RewriteEngine on
RewriteRule ^(.*)/czdetail_([0-9]+)\.html$ $1/czdetail\.php\?czid=$2 [L]
RewriteRule ^(.*)/csdetail_([0-9]+)\.html$ $1/csdetail\.php\?csid=$2 [L]
RewriteRule ^(.*)/zsdetail_([0-9]+)\.html$ $1/zsdetail\.php\?picid=$2 [L]
RewriteRule ^(.*)/qgdetail_([0-9]+)\.html$ $1/qgdetail\.php\?qgid=$2 [L]
RewriteRule ^(.*)/qzdetail_([0-9]+)\.html$ $1/qzdetail\.php\?qzid=$2 [L]
RewriteRule ^(.*)/question_([0-9]+)\.html$ $1/question\.php\?id=$2 [L]
RewriteRule ^(.*)/zsclass_([0-9]+)\.html$ $1/zsclass\.php\?id=$2 [L]
RewriteRule ^(.*)/newsdetail_([0-9]+)\.html$ $1/newsdetail\.php\?newsid=$2 [L]
RewriteRule ^(.*)/news_([0-9]+)\.html$ $1/news\.php\?newsclassid=$2 [L]
RewriteRule ^(.*)shopdetail_([0-9]+)\.html$ $1/shopdetail\.php\?shopid=$2 [L]
----------------------------------------------------------------
环境 php+apache+linux+mysql ,不要只告诉我在线修改自动生成的把 [L] 改成 last的那种,试过了,不行。
感谢vulcans1981 热心分享!但测试没有成功,现在仍然改用apache! 展开
--------------------------------------------------------
RewriteEngine on
RewriteRule ^(.*)/czdetail_([0-9]+)\.html$ $1/czdetail\.php\?czid=$2 [L]
RewriteRule ^(.*)/csdetail_([0-9]+)\.html$ $1/csdetail\.php\?csid=$2 [L]
RewriteRule ^(.*)/zsdetail_([0-9]+)\.html$ $1/zsdetail\.php\?picid=$2 [L]
RewriteRule ^(.*)/qgdetail_([0-9]+)\.html$ $1/qgdetail\.php\?qgid=$2 [L]
RewriteRule ^(.*)/qzdetail_([0-9]+)\.html$ $1/qzdetail\.php\?qzid=$2 [L]
RewriteRule ^(.*)/question_([0-9]+)\.html$ $1/question\.php\?id=$2 [L]
RewriteRule ^(.*)/zsclass_([0-9]+)\.html$ $1/zsclass\.php\?id=$2 [L]
RewriteRule ^(.*)/newsdetail_([0-9]+)\.html$ $1/newsdetail\.php\?newsid=$2 [L]
RewriteRule ^(.*)/news_([0-9]+)\.html$ $1/news\.php\?newsclassid=$2 [L]
RewriteRule ^(.*)shopdetail_([0-9]+)\.html$ $1/shopdetail\.php\?shopid=$2 [L]
----------------------------------------------------------------
环境 php+apache+linux+mysql ,不要只告诉我在线修改自动生成的把 [L] 改成 last的那种,试过了,不行。
感谢vulcans1981 热心分享!但测试没有成功,现在仍然改用apache! 展开
1个回答
展开全部
location / {
###以下为PHPCMS 伪静态化rewrite规则
rewrite ^(.*)show-([0-9]+)-([0-9]+)\.html$ $1/show.php?itemid=$2&page=$3;
rewrite ^(.*)list-([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$2&page=$3;
rewrite ^(.*)show-([0-9]+)\.html$ $1/show.php?specialid=$2;
####以下为PHPWind 伪静态化rewrite规则
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last;
}
###以下为PHPCMS 伪静态化rewrite规则
rewrite ^(.*)show-([0-9]+)-([0-9]+)\.html$ $1/show.php?itemid=$2&page=$3;
rewrite ^(.*)list-([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$2&page=$3;
rewrite ^(.*)show-([0-9]+)\.html$ $1/show.php?specialid=$2;
####以下为PHPWind 伪静态化rewrite规则
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询