** Multiple Index.html Files Giving Me A Problem **

Discussion in 'HTML & Website Design' started by ttechfs, Nov 6, 2015.

  1. #1
    Hi,

    I recently built a website from a sitebuilder and I extracted the files out of the website to upload to my web host but there are too many index files. There's an index file for every page. For example, contact us, about us, blog, etc. There is an index.htm file for every one of them. This isn't a problem and is at the same time. The website works fine but the reason that it is, is because the website linkage looks kind of ugly.

    For example, if I click on the link "About Us", I get "About-us/index.htm"



    Is there a way I can merge these multiple index files into one main index file or no?


    Thank you!
     
    ttechfs, Nov 6, 2015 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Yet another example of sitebuilders fucking up normal webserver setups. What you CAN do, if it's not too many links, is just rename the files (About-us/index.html to about.html, for example) and link directly to those files. However, since I have no idea how the rest of the page is built, I dunno if this is gonna work right out of the box.
    Second option is to make "pretty urls" in .htaccess, removing the "index.html" part alltogether - hence a link to About us would show up as www.domain.com/about_us or something like that
     
    PoPSiCLe, Nov 6, 2015 IP
  3. ttechfs

    ttechfs Well-Known Member

    Messages:
    872
    Likes Received:
    142
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Ahh I see. The only reason I went this particular website builder was because it was easy for me. BUT however, they did not allow certain TLDs to work with the hosting for it. For example, I couldn't use a dot construction domain name. Had to use a main domain like com, org or info which is why I needed to extract all the files out of the website I built to bring to a webhost and now I'm having difficulties.
     
    ttechfs, Nov 6, 2015 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    I'd leave them be apart from naming them .html instead of .htm -- they are already in subdirectories so what's the problem?

    Remember, if a index.htm or index.html is in the subdirectory, the URL to access it can be expressed as just href="/about-us" instead of the longer href="/about-us/index.htm"

    Which is probably what the rubbish site-builder nonsense was trying to accomplish, then went and pissed itself by using the full URI's on every page since, well... It's a sitebuilder, they all seem to be written by people who know nothing about websites for people who know nothing about websites.

    Another approach would be to create a index.php and use htaccess to reroute all non-static requests to it, and then have the index.php hand off to the appropriate HTML file... but that's needlessly complex.

    Also if the page were written properly, the bit you were saying about the domain thing is gibberish; a site should never have domain specific URI's or give a fig tree flogging about where you move it to as all the href/src inside it SHOULD be relative to the document.

    Pretty much that "because it was easy for me" -- that's your problem. Site builders vomit up broken garbage sites with broken garbage methodology -- that's ALL of them I've never seen one that generated anything worth a flying purple fish, and to be brutally frank all they do is delude people who aren't ready to make a website into THINKING they can do so.

    Dimes to dollars what you ended up with is such an accessibility disaster and usability train wreck, it likely needs to be pitched in the bin and started over properly anyways. I'd suggest cutting your losses.
     
    deathshadow, Nov 6, 2015 IP