Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.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重定向301_.htaccess_Redirect - Fatal编程技术网

使用.htaccess重定向301

使用.htaccess重定向301,.htaccess,redirect,.htaccess,Redirect,我需要从第页重定向 到 规则式 Redirect 301 /index.php?route=product/category&path=79_103 http://masterkanz.com.ua/pishushchie-prinadlezhnosti/ruchki-sharikovye 不起作用。我读到这个问题可以用符号“?”来表示。但是我该怎么办呢?试试这个 RewriteEngine On RewriteCond %{QUERY_STRING} ^route=product/

我需要从第页重定向 到

规则式

Redirect 301 /index.php?route=product/category&path=79_103 http://masterkanz.com.ua/pishushchie-prinadlezhnosti/ruchki-sharikovye
不起作用。我读到这个问题可以用符号“?”来表示。但是我该怎么办呢?

试试这个

RewriteEngine On
RewriteCond %{QUERY_STRING} ^route=product/category&path=79_103$
RewriteRule ^index\.php/?$ http://masterkanz.com.ua/pishushchie-prinadlezhnosti/ruchki-sharikovye? [R=301,L]
我已经试过了,它正在工作,您需要使用{QUERY\u STRING}来让规则工作


我希望这会有所帮助。

在目标url的末尾添加一个问号很重要,因为它会从目标url中删除原始查询字符串。问题是您使用了错误的指令来匹配查询字符串。检查@Nikhil的回答。