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 非常简单的301重定向,但无法按预期工作_.htaccess_Redirect_Query String - Fatal编程技术网

.htaccess 非常简单的301重定向,但无法按预期工作

.htaccess 非常简单的301重定向,但无法按预期工作,.htaccess,redirect,query-string,.htaccess,Redirect,Query String,我想重定向这个链接 到 我正在使用这种方法 Redirect 301 /index_cpath-19\.html http://www.example.com/ 它重定向很好,但会在URL栏中生成以下链接 请建议我如何删除此?从中删除index_cpath-19.html,使其看起来像此解决方案非常适合我的问题 RedirectMatch 301 ^/index_cpath-19.html$ http://www.example.com RewriteCond %{QUERY_STRIN

我想重定向这个链接 到

我正在使用这种方法

Redirect 301 /index_cpath-19\.html  http://www.example.com/
它重定向很好,但会在URL栏中生成以下链接


请建议我如何删除此?从中删除index_cpath-19.html,使其看起来像

此解决方案非常适合我的问题

RedirectMatch 301 ^/index_cpath-19.html$  http://www.example.com
RewriteCond %{QUERY_STRING} ^index_cpath-19.html$
RewriteRule ^(.*)$ http://www.example.com/? [R=301,L]