: Index.html in subdirectory will not open I want to have a website structure like this: example.com/ - homepage example.com/solutions/ - this will be the solution parent page example.com/solutions/solution-one
I want to have a website structure like this:
example.com/ - homepage
example.com/solutions/ - this will be the solution parent page
example.com/solutions/solution-one - child solution page
example.com/solutions/solution-two- child solution page
I have setup the example.com/solutions/index.html file so it can be opened as a parent page, but is shows me an error You don't have permission to access /solutions/.html on this server.
What is the problem? How can I open the parent directory page? I am just using regular HTML pages; no CMS or anything.
More posts by @Ogunnowo487
3 Comments
Sorted by latest first Latest Oldest Best
If you can SSH into your host log in and check the folder and file permissions on that sub-directory. they should be normal but may have gotten changed inadvertently.
You can use .htaccess to define the default page but it doesn't sound like locating it is the issue here.
Check that you have no other strangely named files. Try deleting everything in the directory other than your index.html and try again. Your server may be trying to default to something else prior to index.html like home.html for example.
Oh please dont do it like that! Just use a pretty-url code and you can do whatever you want in php:
RewriteEngine on
# If it does not exist as a directory
RewriteCond %{REQUEST_FILENAME} !-d
# And if it does not exist as a file
RewriteCond %{REQUEST_FILENAME} !-f
# Then add .php to get the actual filename
RewriteRule ^(.*)/? index.php?url= [L]
In index.php $_GET['url'] will now be /solutions/solution-one. You can explode or or do whatever you like with it. This is the way to go, not subdirs with an index.
Try to setup "Default page(D)" in the .Htaccess
.htaccess Editor
Example:
DirectoryIndex index.html
order deny,allow
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.