I need URL parameter from a rewritten URL (htacces).
I have this function but it returns NULL:
$.urlParam = function(name){
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (results===null){
return null;
}
else{
return results[1] || 0;
}
};
And this is how I'm calling for the parameter:
var value = $.urlParam('profile');
I need to get "1" from "page.php/profile/1"
Thanks in advance!