Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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忽略重定向URL中的查询字符串_.htaccess_Redirect_Query String - Fatal编程技术网

.htaccess 使用htaccess忽略重定向URL中的查询字符串

.htaccess 使用htaccess忽略重定向URL中的查询字符串,.htaccess,redirect,query-string,.htaccess,Redirect,Query String,我想用以下格式重定向旧站点的URL: http://www.domain.com/us/productos/producto.asp?id_g=1&ID=2 对于此新格式: http://www.domain.com/usa/products/name/ 我该怎么做?我试过这个: Redirect 301 /us/productos/producto.asp?id_g=1&ID=2 http://www.domain.com/usa/products/name/ 但它不起

我想用以下格式重定向旧站点的URL:

http://www.domain.com/us/productos/producto.asp?id_g=1&ID=2
对于此新格式:

http://www.domain.com/usa/products/name/
我该怎么做?我试过这个:

Redirect 301 /us/productos/producto.asp?id_g=1&ID=2  http://www.domain.com/usa/products/name/
但它不起作用。我认为这是因为原始URL的
&
符号。例如,这在没有此符号的其他URL中工作,如下所示:

Redirect 301 /caste/home/home.asp http://www.domain.com/es

你使用php框架吗

如果您使用像codeigniter这样的php框架,那么类似的设置不在.htaccess中,而是在application/config.php中

现在,你使用asp(因为你的url),你最好先看看这个


或者你可以用关键字asp routing或asp pretty url找到谷歌

我没有使用框架。另外,我不需要ASP的漂亮URL,我只需要将旧的.ASP URL重定向到WordPress中工作的新URL。用ASP开发的网站已经不存在了。