我有以下重写规则mod_rewrite的URL(在第二部分条件)
RewriteRule ^/product/([^/]*)/([^/]*)/([^/]*)/([^/]*)/((test_data|data_test)/)?([^/]*)$ /product/?query_one=$1&query_two=$2&query_three=$3&query_four=$4&file_path=$6/$7
在最后file_path
的价值,我结合$6/$7
。
如果$6
没有值,那么file_path
只会是$7
?我不想/
ID $6
是无。简单地说,我想把条件放在这部分。
编辑
https://example.com/product/one/two/three/four/test_data/file.jar
TO
问题是这个网址
https://example.com/product/one/two/three/four/test_file.xml
请建议?
谢谢!
请提供您的源和目标URL的一些例子。 – anubhava
@anubhava问题用例子更新 – Ahsan