【发布时间】:2014-03-21 10:04:45
【问题描述】:
我想知道如何将这个 URL 的各个部分混杂成/ 作为分隔符:
http://fujifilm.in/en/products/consumer_products/digital_cameras/x/fujifilm_x_t1/
我正在寻找所有结果组合,例如
http://fujifilm.in/en/products/consumer_products/digital_cameras/x/fujifilm_x_t1/
http://fujifilm.in/en/products/consumer_products/digital_cameras/x
http://fujifilm.in/en/products/consumer_products/digital_cameras
http://fujifilm.in/en/products/consumer_products
http://fujifilm.in/en/products
http://fujifilm.in/en/
http://fujifilm.in/
http://fujifilm.in/en/fujifilm_x_t1/
http://fujifilm.in/en/products/fujifilm_x_t1/
http://fujifilm.in/en/products/consumer_products/fujifilm_x_t1/
http://fujifilm.in/en/products/consumer_products/digital_cameras/fujifilm_x_t1/
................
................
................
我该怎么做?
【问题讨论】:
-
我很难想象你为什么想要这个。如果是为了获得某种 SEO 效果,我建议不要这样做。你可能有一个所谓的X/Y problem
-
好问题南妮!我需要得到一个较短版本的 url,例如,如果你打开这个 url,它会重定向到 http://www.flipkart.com/moto-x-16-gb/p/itmdthjkza6eburu?pid=MOBDTH3DMB7GEZEK 上的 http://flipkart.com/item/MOBDTH3DMB7GEZEK 用于网页报废我需要这个短 url。希望我让你明白了。
-
@Vind 您在评论中要求的内容与您在问题中要求的内容完全不同。您可能会考虑删除您的问题并提出一个新问题?您的问题应该是如何为我的内容提供短重定向 URL
-
@Andresch Serj 我不这么认为,就像我在上面的评论中提到的那样,我需要找到一个短网址,现在我正在手动执行此操作。如果我自动化这个,我可以使用这个tool 来查找它是否可用。还有关于我的方法的问题吗?
-
@Vind:您在问题中描述的是一个非常独特的请求,以获取所有可能的长网址的混乱版本。如 cmets 中所述,您搜索的是一个希望唯一的短 url。后者可以用一个衬垫
substr(md5(url),0,8)来完成,并检查是否存在以防万一。尽管如此,我实际上不想通过麻烦来回答你最初的问题。它有效:D