lundi 8 octobre 2018

Confused about relative url anchor tag

I'm confused about relative href url in anchor tag. I have a case below:

I have a homepage that can be accessed with abc.com/it or abc.com/it/index with return the same page. In that page I have anchor tag with relative url href='./about' (I can not use absolute or root-relative url in this case). The problem is:

  • When I access the page through url abc.com/it/index then click the anchor link, it will redirect to abc.com/it/about (this is my expected result).

  • But if I access the page through abc.com/it then click the link, it
    will redirect to abc.com/about (this is not my expectation).

Anyone please give me a solution for this. Thank you all.




Aucun commentaire:

Enregistrer un commentaire