简体   繁体   English

301将同一域内的重定向循环重定向到其他服务器

[英]301 redirect loops within the same domain to different server

I'm not sure how to properly articulate this question, so thanks for your patience. 我不确定如何正确表达这个问题,因此感谢您的耐心配合。

I'm migrating a website to a new server (Shopify). 我正在将网站迁移到新服务器(Shopify)。 I have too many inbound links to use their built-in 301 solution because they don't support wildcard redirects. 我的入站链接太多,无法使用其内置的301解决方案,因为它们不支持通配符重定向。 Setting up a secondary server to handle the redirects would work, but since the old domain and the new one are the same how do I prevent redirect loops? 设置辅助服务器来处理重定向是可以的,但是由于旧域和新域相同,如何防止重定向循环?

For example: 例如:

old url: mystore.com?p=123&q=456&r=789
new url: mystore.com/products/some-meaningful-string

My redirect server: 我的重定向服务器:

[code to create the new url from mystore.com?p=123&q=456&r=789]
header("HTTP/1.1 301 Moved Permanently"); 
header("Location: mystore.com/products/some-meaningful-string"); 

Is there a way to set up the dns so that the registrar thinks the domain is on the redirect server, and the redirect server points to Shopify? 有没有办法设置dns,以便注册服务商认为该域位于重定向服务器上,并且重定向服务器指向Shopify? I am wondering if the technique CDNs use would help. 我想知道CDN使用的技术是否会有所帮助。

Thanks in advance. 提前致谢。

It sucks that you cannot generate a simple sitemap of all your current (soon to be old) URLs. 很遗憾,您无法为所有当前(即将过期)URL生成简单的站点地图。 That is really your only sane choice, without deep diving into the crazy. 这确实是您唯一的理智选择,而无需深深地陷入疯狂。

A simple loop and with one line of code, you generate a 301 redirect and Shopify kicks in appropriately and you lose no juice on the old URLs. 一个简单的循环并使用一行代码,您可以生成301重定向,并且Shopify会适当启动,并且不会浪费旧的URL。

Are you sure you cannot just write a simple script to tease out a listing of all your old URLs and map them to new ones? 您确定不能只编写简单的脚本来列出所有旧URL并将其映射到新URL的方法吗?

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

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