duanfei1975 2015-06-24 09:34
浏览 105
已采纳

RewriteBase有2个参数

I am working on a rewrite base file - and need to add an extra parameter

currently its reading like this

RewriteEngine on
RewriteBase /img/pins/
RewriteRule  ^(.*)$ pins.php?n=$1 [QSA,L]

and that is fine as it comes out /img/pins/1 n=1

but I need to write the file to accomodate a new flag

so /img/pins/1/check

n=1 f=check

RewriteEngine on
RewriteBase /img/pins/
RewriteRule  ^(.*)$ pins.php?n=$1&f=$2 [QSA,L]

^ but this current version indicates n=1/check f=

  • 写回答

2条回答 默认 最新

  • douwen7516 2015-06-24 09:44
    关注

    If i undestand correctly. You need two group. If you want it will work with empty path or 1 and 2 groups, don't remove question sign after slash

    RewriteEngine on
    RewriteBase /img/pins/
    RewriteRule  ^([^/]*)/?(.*)$ pins.php?n=$1&f=$2 [QSA,L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥200 求博主教我搞定neo4j简易问答系统,有偿
  • ¥15 nginx的使用与作用
  • ¥100 关于#VijeoCitect#的问题,如何解决?(标签-ar|关键词-数据类型)
  • ¥15 一个矿井排水监控系统的plc梯形图,求各程序段都是什么意思
  • ¥15 ensp路由器启动不了一直报#
  • ¥50 安卓10如何在没有root权限的情况下设置开机自动启动指定app?
  • ¥15 ats2837 spi2从机的代码
  • ¥200 wsl2 vllm qwen1.5部署问题
  • ¥100 有偿求数字经济对经贸的影响机制的一个数学模型,弄不出来已经快要碎掉了
  • ¥15 数学建模数学建模需要