不带参数的redirectmatch?
问题描述:
的URL www.ex.com/product_info.php?products_id=23 & osCsid = 1ed12不带参数的redirectmatch?
应重定向到www.ex.com/pagex.htm
我试过的.htaccess与
“RedirectMatch 301。” 星形 “product_info.php” 星形 “https://ex.com/pagex.htm” (其中, “星”= *)
但随后的参数被转发到,所以 https://ex.com/pagex.htm?products_id=23&osCsid=1ed12
如何摆脱“?”和一切参数的东西?
答
RedirectMatch
指令不会删除查询字符串。使用mod_rewrite
基于规则的,因为这一个:
RewriteEngine On
RewriteRule ^/?product_info\.php$ https://ex.com/pagex.htm? [L,NC,R=301]
尾随?
剥去在目标网址的任何现有的查询字符串。
@Caro:这是否工作? – anubhava