Short URL

(I) What is the short URL?

Short URL (Short URL): refers to the form of relatively short and has a link function automatically redirected to the specified URL.

 

(Ii) the advantage of a short URL

⑴ real-time monitoring data to promote, facilitate timely adjustment of operating strategy based on the data

By short chain, you can view data in real-time promotion, understanding of the various channels, data link different situation, timely adjustment of strategies, improve operational efficiency.

 

⑵ dimensional data reporting, analysis, deeper, clearer understanding of user portrait

By the time dimension, area, browsers, devices, etc., analysis of user data, a clear picture of their products corresponding to the user, to promote more targeted.

 

⑶ particular scene hoplinks meet the individual needs of promotion

Use by time of day, by city, by device, according to parameters, such as a random function to create short-chain, you can jump in different links according to the specified scene to meet the individual needs of promotion, efficient and convenient.

 

⑷ intelligent filtering false amount, more real and effective data

Filtering spurious traffic, data filtering step of reduction, more analytical data.

 

⑸ permanent, do not worry about expired promotional link leads to failure

The use of short-chain platform generates a link does not expire fixed, permanent, do not worry about broken links affect promotion.

 

⑹ simplify long link, the more beautiful the promotion of content, SMS push to reduce the occupancy of words

The original link may carry multiple parameters, the link is very long, the shorter, more highlight the text; in push SMS can also reduce the number of words in the link text messages occupancy and reduce costs.

 

(Iii) generate a short URL and restore

⑴ can enter inside Baidu: generating short URLs; or directly open the site: https://dwz.cn/

⑵ you will open this page:

 

⑶ enter the long address in it, generate a short URL to be saved.

⑷ You can also put a short address entered into a long address, click on the option on the right on it

 

⑸ For example: my blog address is: https://www.cnblogs.com/shihaiying/

            My blog is short address: https://dwz.cn/w1SXaAtD

 

(Iv) the principle of short URL

⑴ flowchart as follows:

   Generate short URL: ☟ restore long URL: ☟

 

⑵ text principle described in detail:

1) The length of the URL string md5 generates 32-bit signature, divided into four segments, each one byte (i.e. 8 bits);
 
2)对这四段循环处理, 取4个字节(32位), 将他看成16进制串与0x3fffffff(30位1)与操作, 即超过30位的忽略处理;
 
3)这30位分成6段, 每5位的数字作为字母表的索引取得特定字符, 依次进行获得6位字符串;
 
4)总的md5串可以获得4个6位串; 取里面的任意一个就可作为这个长url的短url地址;

 

㈤短网址跳转

⑴服务器通过路径参数查询到真实的长网址,然后使用301/302跳转到真实的网址即可!

⑵关于跳转,301 是永久重定向,302 是临时重定向。

⑶短地址一经生成就不会变化,所以用 301 是符合 http 语义的,浏览器会记录跳转地址,同时对服务器压力也会有一定减少。

⑷但是如果使用了 301,我们就无法统计到短地址被点击的次数了,如果对数据统计有要求的话,使用302跳转可能比较好一些!

 

㈥短网址安全

⑴短链接虽然方便了传输和记忆,但是由于链接组成的字符个数少,更容易被爆破、猜测攻击,攻击者可以轻松遍历所有字符组成的链接!

⑵所以不建议使用短链接发送具有私密性的网址,比如说重置密码链接,对一些权限、敏感信息的链接要做好二次鉴权!

 

参考:https://juejin.im/post/5ce3ec5d6fb9a07ea712e5e0

Guess you like

Origin www.cnblogs.com/shihaiying/p/11983074.html