【发布时间】:2012-05-30 20:33:41
【问题描述】:
我似乎对 .htaccess 重写器有疑问。
我想做的是这种形式的调度员:
[website]/[parameter1-text]/[parameter2-text]
我的 .htaccess 中有以下内容:
RewriteRule ^(.*)/(.*)$ dispatcher.php?s1=$1&s2=$2
到目前为止一切顺利。但是 s1 和 s2 是一些需要在数据库(mysql)中匹配的变量,并以以下格式返回为脚本 view.php 提供的真实变量:
view.php?category=[s1]&subcategory=[s2]&objects=5
如何使用 header("Location: /view.php[...]"); 正确重定向它并保持 url 不变(例如:http://example.com/CARS/BLUE http://example.com/SLIPPERS/RED/)
【问题讨论】: