aman
aman

Reputation: 17

trying to link two or more pages in html but error loading page

I'm building my blog, I have done everything perfectly, but when it came to linking two pages, it gave me this error

error loading page

however, I have made sure that all my files are in the same directory!

<ul class="flex-lg flex-lg-row justify-content-lg-center align-content-lg-center">
    <li class="current-menu-item"><a href="index.html">Home</a></li>
    <li><a href="travelling.html">Travelling</a></li>
    <li><a href="health.html">Health</a></li>
    <li><a href="#">Photos and videos</a></li>
    <li><a href="#">about me</a></li>
    <li><a href="contact.html">Contact</a></li>
</ul>

here is my code

what is the problem?

Upvotes: 2

Views: 945

Answers (3)

user12085130
user12085130

Reputation:

Finally this help you

I only add website main url before files in anchor tag.

<li class="current-menu-item"><a href="https://yourwebsite.com/index.html">Home</a></li>
<li><a href="https://yourwebsite.com/travelling.html">Travelling</a></li>
<li><a href="https://yourwebsite.com/health.html">Health</a></li>
<li><a href="#">Photos and videos</a></li>
<li><a href="#">about me</a></li>
<li><a href="https://yourwebsite.com/contact.html">Contact</a></li>

Upvotes: 1

user12085130
user12085130

Reputation:

Hi your code is correct and you are saying that you will getting an error. In my point of view this type of errors occurs when you will made changes in your .htaccess file. if you made changes in your .htaccess file this code will help you

Replace this :-

<li class="current-menu-item"><a href="index.html">Home</a></li>
<li><a href="travelling.html">Travelling</a></li>
<li><a href="health.html">Health</a></li>
<li><a href="#">Photos and videos</a></li>
<li><a href="#">about me</a></li>
<li><a href="contact.html">Contact</a></li>

To this :-

<li class="current-menu-item"><a href="/index.html">Home</a></li>
<li><a href="/travelling.html">Travelling</a></li>
<li><a href="/health.html">Health</a></li>
<li><a href="#">Photos and videos</a></li>
<li><a href="#">about me</a></li>
<li><a href="/contact.html">Contact</a></li>

If these changes not working so use this code

<li class="current-menu-item"><a href="index">/Home</a></li>
<li><a href="/travelling">Travelling</a></li>
<li><a href="/health">Health</a></li>
<li><a href="#">Photos and videos</a></li>
<li><a href="#">about me</a></li>
<li><a href="/contact">Contact</a></li>

Or you will not made changes in your .htaccess file so you also try this code.

Hope this will help you.

Thank you.

Upvotes: 1

Balram Kamble
Balram Kamble

Reputation: 49

your code is correct, you made changes in your .htaccess file. remove .php, .html, .htm extensions with .htaccess.

try this code

<li class="current-menu-item"><a href="index">Home</a></li>
<li><a href="travelling">Travelling</a></li>
<li><a href="health">Health</a></li>
<li><a href="#">Photos and videos</a></li>
<li><a href="#">about me</a></li>
<li><a href="contact">Contact</a></li>

Upvotes: 1

Related Questions