提问人:Paulo 提问时间:9/14/2023 更新时间:9/14/2023 访问量:8
Htaccess - 在重定向中使用查询字符串作为文件夹名称
Htaccess - Use query string as folder name in redirect
问:
我正在尝试重定向自
自
https://example.com/search/keyword/QUERY/search-in/product/cat-in/all/search-other/product
我尝试了以下代码
RewriteCond %{QUERY_STRING} ^s=(\w+)$
RewriteRule (.*) https://example.com/%1 [R=302,L]
这给了我这个结果
https://example.com/search/keyword/QUERY?s=QUERY/search-in/product/cat-in/all/search-other/product
出于某种原因,我得到的查询字符串重复,并且参数名称介于两者之间。 我应该在此代码中修复什么以仅获取查询字符串而不获取其余部分?
答: 暂无答案
评论
QSD
标志。