简体   繁体   English

301 重定向不适用于查询字符串 URL

[英]301 Redirection not working on Query string URL

I wan't to redirect independently query string URL without affecting rest of redirection.我不想在不影响重定向的 rest 的情况下独立重定向查询字符串 URL。

I used below code for that but it is not working.我为此使用了下面的代码,但它不起作用。

Redirect 301 /contact/index.php?main_page=index&cPath=7/  https://www.abc.xyz/contact-us.php
Redirect 301 /contact/index.php?main_page=index&cPath=7   https://www.abc.xyz/contact-us.php

Also I used below 301 redirection but it is redirect to abc.xyz/page/2我也使用了低于 301 的重定向,但它被重定向到abc.xyz/page/2

Redirect 301 /tag/metal-roof/page/2/    https://www.abc.xyz/solar-power.php
Redirect 301 /tag/metal-roof/page/2     https://www.abc.xyz/solar-power.php

Redirect 301 /tag/metal-roof/   https://www.abc.xyz/
Redirect 301 /tag/metal-roof    https://www.abc.xyz/

Using Below code at least I am able to redirect to that page but not able to remove query string.使用下面的代码至少我能够重定向到该页面但无法删除查询字符串。

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^contact\/index\.php$ "https\:\/\/www\.abc\.xyz\/contact\-us\.php" [R=301,L]

After redirection URL look like:重定向后 URL 看起来像:

https://www.abc.xyz/contact-us.php?main_page=index&cPath=7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM