Open modal content from a link on another page
<p>Morning, 
Can anyone shed any light on where I'm going wrong here please? I'm trying to anchor an image on index.html to modal content on mainportfolio.html. My link on index.html looks like this:</p>

<pre><code>&lt;div class="col-md-4 col-sm-6"&gt;
&lt;a href="mainportfolio2.html#portfolioModal93"&gt;
&lt;img class="img-responsive img-portfolio img-hover" src="img/homePage/700x450image.png"&gt;&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>And I want that to open this, which is on mainportfolio2.html:</p>

<pre><code>&lt;div class="portfolio-modal modal fade" id="portfolioModal93" tabindex="-1" role="dialog" aria-hidden="true"&gt;
    &lt;div class="modal-dialog"&gt;
        &lt;div class="modal-content"&gt;
            &lt;div class="close-modal" data-dismiss="modal"&gt;
                &lt;div class="lr"&gt;
                    &lt;div class="rl"&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="container"&gt;
                &lt;div class="row"&gt;
                    &lt;div class="col-lg-8 col-lg-offset-2"&gt;
                        &lt;div class="modal-body"&gt;
                            &lt;h2&gt;Image&lt;/h2&gt;
                            &lt;p class="item-intro text-muted"&gt;Example text&lt;/p&gt;
                            &lt;p&gt;More example text&lt;/p&gt;
                            &lt;img class="img-responsive img-centered" src="img/image1.jpg" alt=""&gt;                      
                            &lt;button type="button" class="btn btn-primary" data-dismiss="modal"&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt; Close Window&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>However, all that happens is that you're redirected to the top of the portfolio page. I've tried adding the full url to the link on index.html, which didn't work, and I've tried a forwards slash between 
"mainportfolio2.html/#portfolioModal93"
Which serves up a 404 error. This seems like it should be very simple and yet I can't figure it out.
Can anyone help?
Thanks in advance.</p>