I have a website with subpages that have URLs which look something like this:
https://www.example.com/hello/world
https://www.example.com/hello/earth
In cpanel, my file structure for those pages looks something like this:
[folder]
hello
└ [folder]
world.html
earth.html
.htaccess
index.html
My .htaccess file has the following rule to account for missing .html file extensions:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
How do I make https://www.example.com/hello load as a working webpage?
I have tried simply adding hello.html to the folder to no avail -- like so:
[folder]
hello
└ [folder]
world.html
earth.html
.htaccess
hello.html
index.html
When I attempt to access https://www.example.com/hello in that example, it leads me to my 404 page, but .../hello/world and .../hello/earth still work. https://www.example.com/hello.html does work, but I don't want the .html file extension to be visible to the end user.
I have yet to find a solution to hide the .html file extension in this situation. Help in doing so would be appreciated!