Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Using folders as directory not working?

Discussion in 'General Discussion' started by Kualajimbo, Sep 9, 2017.

  1. Kualajimbo

    Kualajimbo Registered

    Joined:
    Sep 9, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Australia
    cPanel Access Level:
    Website Owner
    I've created a custom website where each page is it's own index.html file tucked away in its own folder, it was already painful enough uploading to Cpanel (because you can't upload folders for some reason) but then this tactic doesn't even work!

    For example, my 'about' page is an index.html file in a folder called "About", in my home pages code the link to the about page looks like this: <a href="/About"><p>ABOUT<p></a>. But when I load that HTML and click on the ABOUT hyperlink I get a 404 page not found error.

    The reason I did this was to avoid having .html at the end of all my websites URLs. I did manage to get this to work but only changing the <a> tag to say href="/About/index.html", which loaded the page, but the URL has a /index.html on the end of it which is even worse than the problem I was trying to solve.

    All this trouble and I just can't help wonder "does Cpanel just not let you use folders as a website directory?" So does anyone here have any suggestions? am I missing something here? or do I just need to find another way to make the website? Thank you.
     
  2. linux4me2

    linux4me2 Well-Known Member

    Joined:
    Aug 21, 2015
    Messages:
    201
    Likes Received:
    47
    Trophy Points:
    28
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Try adding a following forward-slash to your hyperlinks like this:
    Code:
    <a href="/About/">About</a>
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,884
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You may also want to try using the full paths (e.g. /home/$username/public_html/folder-name).

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice