I am using the below code for getting the current URL in jQuery.
var pathname = window.location.pathname;
console.log(pathname);
Now I have got the url like this
http://localhost/TantraProjects/CollectiveCraft/Repo/WebSite/index.php/crafts/t-lights.html
I want to convert the URL into this
http://localhost/TantraProjects/CollectiveCraft/Repo/WebSite/index.php
Is there any a way to convert into URL as above, whatever the URL is ?