apache - htaccess 重定向或重写规则
问题描述
基本上,我有这个我想概括的 htaccess 规则:
RewriteCond %{QUERY_STRING} (^|&)sale/details\.php\?id\=1234($|&)
RewriteRule ^properties$ /property/1234?&%{QUERY_STRING}
我想在条件中用正则表达式 ([0-9]+) 替换 1234 并在我的规则中检索如下:
RewriteCond %{QUERY_STRING} (^|&)sale/details\.php\?id\=([0-9]+)($|&)
RewriteRule ^properties$ /property/$1?&%{QUERY_STRING}
但它不起作用,我做错了什么?
提前致谢。
解决方案
推荐阅读
- ios - 在键中嵌套 JSON 字典?
- angular - Angular HttpInterceptor 未在嵌套的 Observables 上触发
- javascript - 2个相同形式的模态,但1个按钮没有关闭
- python - 单击时如何禁用按钮?
- hadoop - 更改表列名 parquet 格式 Hadoop
- mysql - 更新非常大的数据库中的字符串
- c - 如何从相对二进制文件中删除记录?
- c++ - 有没有办法证明下面的第二个片段在函数声明之前插入了一个不可见的声明`struct S;`?
- z3 - 指定 Z3 sum 类型的构造函数的无量词方式
- php - 如何组成一个包含多个部分的视图,这些部分具有需要跨越的变量?