Mobile app version of vmapp.org
Login or Join
Ogunnowo487

: 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

@Ogunnowo487

Posted in: #Htaccess #Html #SiteStructure

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.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Ogunnowo487

3 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie594

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.

10% popularity Vote Up Vote Down


 

@Chiappetta492

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.

10% popularity Vote Up Vote Down


 

@Sue5673885

Try to setup "Default page(D)" in the .Htaccess

.htaccess Editor

Example:

DirectoryIndex index.html
order deny,allow

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme