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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    168
    Likes Received:
    36
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,220
    Likes Received:
    1,376
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Thank you.
     
Loading...

Share This Page