Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
.htaccess 使用htaccess重写规则更改查询字符串键名称_.htaccess_Joomla_Url Rewriting_Query String - Fatal编程技术网

.htaccess 使用htaccess重写规则更改查询字符串键名称

.htaccess 使用htaccess重写规则更改查询字符串键名称,.htaccess,joomla,url-rewriting,query-string,.htaccess,Joomla,Url Rewriting,Query String,我们正在更改附属软件,我不知道如何重写查询字符串键的名称以实现以下目标: 重定向到: 到目前为止,我已经: RewriteCond %{QUERY_STRING} ^old_key_name=([0-9]+) RewriteRule ^ %{REQUEST_URI}?new_key_name=%1 [L,R=301] 这不会保留产品的完整路径,但会导致: 缺少/path/to/productx/ 我将规则放在Apache服务器上Joomla htaccess文件的底部。是否可以将产品的

我们正在更改附属软件,我不知道如何重写查询字符串键的名称以实现以下目标:

重定向到:

到目前为止,我已经:

RewriteCond %{QUERY_STRING} ^old_key_name=([0-9]+)

RewriteRule ^ %{REQUEST_URI}?new_key_name=%1 [L,R=301]
这不会保留产品的完整路径,但会导致:

缺少
/path/to/productx/


我将规则放在Apache服务器上Joomla htaccess文件的底部。是否可以将产品的完整路径添加到重定向规则中?

我刚刚将该规则移动到htaccess文件的顶部,并按预期工作。我想问题出在默认的Joomla SEF重写规则上。

我刚刚将该规则移到了htaccess文件的顶部,它可以正常工作。我想问题出在Joomla SEF的默认重写规则上。请将您的解决方案作为答案(而不是评论)发布,然后将您的答案打绿色勾,以便此页面被视为已解决。