301重定向网址

发布于 2024-09-26 05:03:07 字数 362 浏览 2 评论 0原文

我正在尝试使用 301 将旧网址重定向到新网址

我需要以下 301 的 RewriteQueryString 示例? http://www .example.com/search/?depId=1&typeCatId=1 到以下 http://www.example.com/mens/clothing

因此,当我在浏览器中输入长网址时,我会被重定向到新的,较短的网址

有什么想法吗?

I'm trying to redirect an old url to a new one using 301

I need an example of RewriteQueryString for the following 301? http://www .example.com/search/?depId=1&typeCatId=1 to the following http://www.example.com/mens/clothing

So when I type in the long URL in the browser, I am redirected to the new, shorter URL

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

山田美奈子 2024-10-03 05:03:08
RewriteEngine On
RewriteRule ^search/\?depId=1&typeCatId=1$ /mens/clothing [R=301]

^ 尝试一下。

RewriteEngine On
RewriteRule ^search/\?depId=1&typeCatId=1$ /mens/clothing [R=301]

^ Try that.

々眼睛长脚气 2024-10-03 05:03:08

您可以在您的 . htaccess 文件或 apache 配置。如果您要映射许多不同的部门等,您可以看看 RewriteMap 功能。在 RewriteRule 之后使用 [R] 标志将导致浏览器重定向,而不仅仅是内部重定向。使用 [R=301] 将使其成为 301 重定向。

You could use mod_rewrite either in your .htaccess file or the apache configuration. You might take a look at the RewriteMap feature if you are going to have a lot of different departments, etc. to map. Using the [R] flag after the RewriteRule will cause the browser to redirect instead of just being an internal redirect. Using [R=301] will make it a 301 redirect.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文