title: Anchor <a> to Another Page Using Relative Paths - PHP
body: <p>I have an HTML page that has several anchors on it:</p>
  
  <pre><code>&lt;h4&gt;Anchor 1&lt;/h4&gt;&lt;a name="anchor1"&gt;&lt;/a&gt;
  &lt;p&gt;blah blah&lt;/p&gt;
  &lt;h4&gt;Anchor 2&lt;/h4&gt;&lt;a name="anchor2"&gt;&lt;/a&gt;
  &lt;p&gt;blah blah&lt;/p&gt;
  &lt;h4&gt;Anchor 3&lt;/h4&gt;&lt;a name="anchor3"&gt;&lt;/a&gt;
  &lt;p&gt;blah blah&lt;/p&gt;
  </code></pre>
  
  <p>Then, I have a PHP array to relative paths:</p>
  
  <pre><code>$anchor_array = array(
      'site/path/#anchor1' =&gt; 'Anchor 1',
      'site/path/#anchor2' =&gt; 'Anchor 2',
      'site/path/#anchor3' =&gt; 'Anchor 3',
  );
  </code></pre>
  
  <p>Each <code>site/path/</code> has an <code>index.php</code> file inside so using <code>.htaccess</code> I'm able to use a link like this:</p>
  
  <p><code>site/path/</code></p>
  
  <p>This works fine, but when I add the anchor to it (eg,<code>site/path/#anchor1</code>) I get sent to the correct page, but not to the anchor location, just to the top of page.</p>
  
  <p>What am I missing?</p>
  
  <p>** EDIT **</p>
  
  <p>After taking Salman A's advice, I was able to get 2/3 anchors to work properly.  But one was still causing me trouble.  I thought, perhaps, the browser is confusing the anchor name I have specified with something else.  So I did a test and changed the anchor from <code>anchor1</code> to <code>the_anchor1</code> (actually, I changed it from <code>history</code> to <code>our-history</code>) and it works now.</p>
  
  <p>Is there a reason using <code>history</code> as anchor name is bad?</p>