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!

Webpage without the .html extension issue

Discussion in 'General Discussion' started by nleeio, Jun 24, 2018.

  1. nleeio

    nleeio Registered

    Joined:
    Jun 24, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    hk
    cPanel Access Level:
    Website Owner
    Hello,

    I recently uploaded a number of html and css files on to CPanel. I'm running into issues when trying to access other pages on my website.

    For example:

    example.com > gallery (example.com/gallery/)
    - I get a 403 error, my gallery page is located in the same folder as my index.html
    - it also doesnt recognise/can't access my .css file (exact same one used by index.html)
    - In my index file I have it like this: <li><a href="/gallery">G A L L E R Y</a>
    - However, example.com/gallery.html works just fine.

    I have no problem loading my blog page (example.com/blog)
    - the .html version works fine too
    - I am able to load the page without .html
    - In my index file I have it like this: <li><a href="/blog">B L O G</a>
    - also noticed there isn't an extra "/" at the end of the url

    This is my .htcaccess file:
    DirectoryIndex index.html

    #example.com/page will display the contents of example.com/page.html
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^(.+)$ $1.html [L,QSA]

    #301 from example.com/page.html to example.com/page
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
    RewriteRule ^(.*)\.html$ /$1 [R=301,L]

    I would appreciate any help with this issue, I want to be able to load my gallery page without the .html extension
     
    #1 nleeio, Jun 24, 2018
    Last edited by a moderator: Jun 24, 2018
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,231
    Likes Received:
    1,938
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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