关于 apache:使用 PHP 获取值的简单 mod 重写

试图采取:

1

search.php?key=23&category=testing

并制作:

1

/23/testing.html

用这个:

1

RewriteRule ^([^/]*)/([^/]*)\\.html$ /?key=$1&category=$2 [L]

对于我的生活,我无法解决这个问题......或者如果有更好的方法,请指出正确的方向。

** 更新

好的,在放弃这个之后,我终于联系了托管公司,看看我的域是否有问题导致它无法正常工作。这是他们告诉我的:

  • You do not have a rewrite condition and you only have a simple rewrite. For the code to >always work properly you should normally set a"RewriteCond" with a valid pattern.

  • You have used the"?" question mark character in your code although this is an escape >character and doing so would only cause a rewrite to index.php based upon your code as >everything after the question mark gets escaped.

Please consider using a"RewriteCond" in your code and also use regexes to properly escape >the"?" character and avoid unexpected behavior.

谁能帮帮我?谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值