title: Redirect to hash URL
body: <p>I'm building a site with a hashchange on wordpress, all working good. It just loads a single.php template file into a div.</p>
  
  <p>The problem is that i can still access my single url (http://www.mydomain.com/my-single-post). Since its not having any head and style tags with it, i don't want people to go over there. Also google has picked up the direct links, because I use the href attribute to load content into the div.</p>
  
  <p>So my question is:</p>
  
  <p>If someone clicks a link lets say in a forum, <a href="http://www.mydomain.com/my-single-post" rel="nofollow">http://www.mydomain.com/my-single-post</a> , is it possible to redirect him instantly to <a href="http://www.mydomain.com/#my-single-post" rel="nofollow">http://www.mydomain.com/#my-single-post</a> ? I have researched that it has something to do with .htaccess, but I also have Pages, where i don't want the hash infront of the page-name.</p>
  
  <h2>EDIT</h2>
  
  <p>I have a small update. If this code removes the hash-tag from the url and redirects to a non-hash url, then how to put this code in reverse?</p>
  
  <pre><code>var current_hash = location.hash;
          current_hash = current_hash.replace(/#/,'');
      if(current_hash.length&gt;1){
          // we have something after the #. redirect as if the # wasn't there.
          window.location.href=current_hash;
      }
  </code></pre>