Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正则表达式将参数传递到wordpress页面,该页面带有带有漂亮URL的短代码_Wordpress_.htaccess_Mod Rewrite - Fatal编程技术网

正则表达式将参数传递到wordpress页面,该页面带有带有漂亮URL的短代码

正则表达式将参数传递到wordpress页面,该页面带有带有漂亮URL的短代码,wordpress,.htaccess,mod-rewrite,Wordpress,.htaccess,Mod Rewrite,目前,我正在使用此页面 它有一个短代码,可以读取使用GET传递的参数 加入 它将读取get变量并生成一些额外的内容,然后根据区域的不同再次更改 编辑重写规则不是问题,因为我找到了添加规则的解决方案 用于将页面名称转换为正确重写规则的现有规则 适用于/弹簧制造商/ (.?.+?)(?:/([0-9]+))?/?$ 改写成 index.php?pagename=$matches[1]&page=$matches[2] 理想情况下,我希望 /弹簧制造商/弹簧/张力/区域/欧文 这

目前,我正在使用此页面

它有一个短代码,可以读取使用GET传递的参数

加入

它将读取get变量并生成一些额外的内容,然后根据区域的不同再次更改

编辑重写规则不是问题,因为我找到了添加规则的解决方案

用于将页面名称转换为正确重写规则的现有规则 适用于/弹簧制造商/

(.?.+?)(?:/([0-9]+))?/?$   
改写成

index.php?pagename=$matches[1]&page=$matches[2]
理想情况下,我希望 /弹簧制造商/弹簧/张力/区域/欧文

这将有一个重写的URL类似于

/spring/(.*)/area/(.*) ?spring=$1&area=$2
我就是不能把这两条规则有效地结合起来,让它发挥作用。

Regex模式

(springs-manufacturer)/spring/(.*)/area/(.*)$
匹配

index.php?pagename=$matches[1]&spring=$matches[2]&area=$matches[3]