TechLifeForum
Website problem - Printable Version

+- TechLifeForum (http://tech.reboot.pro)
+-- Forum: Programming and Development (http://tech.reboot.pro/forumdisplay.php?fid=15)
+--- Forum: Web Development & Web Graphics (http://tech.reboot.pro/forumdisplay.php?fid=18)
+--- Thread: Website problem (/showthread.php?tid=5236)



Website problem - william7 - 12-19-2016

I did this website, at http://jimsweldandfix-itshop.com/index.html, for a friend. You'll notice when you click on the same page twice it will give an "Internal Server Error." I've never had this happen before and can't figure it out. I know it's something simple. Notice how it lists the folder "About" twice (see below). It won't do it on the home page as it doesn't have a folder. Only on the "About", "Samples of Jim's Work", and "Contact Jim" pages.



RE: Website problem - william7 - 12-20-2016

Also, below is my navigation html.
Code:
<nav>
<ul>
<li><a href="../index.html">Home</a></li>
<li><a href="About/index.html">About</a></li>
<li><a href="../weldsamples/index.html">Samples of Jim's Work</a></li>
<li><a href="../Contact/index.html">Contact Jim</a></li>
                     
</ul>
</nav>



RE: Website problem - Mazzn - 12-23-2016

Hey, your problem is that your navigation uses links relative to the folder your page is in. As you've already noticed yourself, if you're on the "About" page, it'll navigate from "...com/About/index.html" to "...com/About/About/index.html", because your navigation is relative. If the link says "About/index.html" and you're already in the Folder "About/", it'll try to go to "About/About/"

As your navigation area always stays the same even in the sub folders, you might want absolute links:

Code:
<ul>
<li><a href="/index.html">Home</a></li>
<li><a href="/About/index.html">About</a></li>
<li><a href="/weldsamples/index.html">Samples of Jim's Work</a></li>
<li><a href="/Contact/index.html">Contact Jim</a></li>  
</ul>

Note the / in the beginning of the paths, that is the important change you'll have to make. That code can be used on every page without worrying.

Alternatively you could name your .html pages accordingly (about.html, contact.html...), move them out of the folders and use relative links (href="./about.html" or just href="about.html")

Hope I could help you out!