title: retrieve original url of a wordpress page
body: <p>I know that, wordpress redirects closely matched urls to its original url.However, I need to know the actual url at the very beginning of code execution. Is it possible?</p>
  
  <p>1) If there is any method that takes a url as parameter and returns its original wordpress url
  , that would be great, but not sure, whether it exists or not. Is there something like that?</p>
  
  <p>2) where in the code actually does this test and redirection please?</p>
  
  <p>3) Is there any hook that I can use to add a plugin to control this situation? </p>
  
  <p>Thanks in advance. </p>
  
  <p>Example:</p>
  
  <p>Suppose, I have a post on this url: "http://mydomain.com/example-post-page"</p>
  
  <p>Now if I try to access it via "http://mydomain.com/example-post-page/", it will redirect you to original first url. It is true for other several small changes in url, all will redirect you to the actual permalink url.</p>
  
  <p>My goal is to control this redirection. That's why, when I am on "http://mydomain.com/example-post-page/" , I like to know(my code in on root index.php) whether this is the origianl permalink or is that something else, before it redirects.</p>