Input:
- Base URL:
www.example.com/1/2/index.php
- Relative URL:
../../index.php
Output:
- Absolute URL:
www.example.com/index.php
It would be perfect, of it would be done using sed.
As I understand, this regex should delete one somefolder/
in for every ../
in the URL.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…