Webpage without the .html extension issue
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:
G A L L E R Y
- 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:
B L O G
- 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
Please sign in to leave a comment.
Comments
0 comments