Storing a URL from a basic page using a custom module
In your custom module, try to implement the hook_preprocess_page

function my_module_preprocess_page($vars) {
  print_r(current_path());exit;
}


This will retrieve the current URL of the site.