The url contains the custom context two times, please look into the issue,
Ex:- if "rapid" is context then it is giving /rapid/rapid/web/guest/........
"Steps to replicate:"
1) Create a plugin with the below code snippet.
<input type="button" onclick="callMe()" name="hello">
2) Deploy it in a running instance of Liferay 6.2 whose context has been changed.